From 749249137fc2f99a8217626ea3b80ee2b36262df Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Mon, 22 Sep 2025 19:07:56 +0200 Subject: [PATCH 01/11] script-functions: drop isgrmlhd --- etc/grml/script-functions | 4 ---- 1 file changed, 4 deletions(-) diff --git a/etc/grml/script-functions b/etc/grml/script-functions index 4d6bcea8..62f0cded 100644 --- a/etc/grml/script-functions +++ b/etc/grml/script-functions @@ -160,10 +160,6 @@ isgrmlcd(){ [ -f /etc/grml_cd ] && return 0 || return 1 } -isgrmlhd(){ - [ -f /etc/grml_cd ] && return 1 || return 0 -} - checkgrmlsmall(){ grep -q small /etc/grml_version 2>/dev/null && return 0 || return 1 } From f31815af45497ea92c38de846dae03abc0e98c99 Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Mon, 22 Sep 2025 19:08:25 +0200 Subject: [PATCH 02/11] script-functions: drop unused checkgrmlsmall --- etc/grml/script-functions | 4 ---- 1 file changed, 4 deletions(-) diff --git a/etc/grml/script-functions b/etc/grml/script-functions index 62f0cded..2e9c65c8 100644 --- a/etc/grml/script-functions +++ b/etc/grml/script-functions @@ -159,10 +159,6 @@ grmlversion(){ isgrmlcd(){ [ -f /etc/grml_cd ] && return 0 || return 1 } - -checkgrmlsmall(){ - grep -q small /etc/grml_version 2>/dev/null && return 0 || return 1 -} # }}} # {{{ filesystems (proc, pts, sys) From 7c35efe2c543c8d9451c11332eb833bbdc54dd92 Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Mon, 22 Sep 2025 19:09:11 +0200 Subject: [PATCH 03/11] script-functions: drop unused grmlversion --- etc/grml/script-functions | 4 ---- 1 file changed, 4 deletions(-) diff --git a/etc/grml/script-functions b/etc/grml/script-functions index 2e9c65c8..fd29e8fc 100644 --- a/etc/grml/script-functions +++ b/etc/grml/script-functions @@ -152,10 +152,6 @@ isgrml(){ [ -f /etc/grml_version ] && return 0 || return 1 } -grmlversion(){ - cat /etc/grml_version -} - isgrmlcd(){ [ -f /etc/grml_cd ] && return 0 || return 1 } From f28330a81df013759e78cc41547320d5a84bc651 Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Mon, 22 Sep 2025 19:10:37 +0200 Subject: [PATCH 04/11] script-functions: drop unused mount_(proc|pts|sys) functions --- etc/grml/script-functions | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/etc/grml/script-functions b/etc/grml/script-functions index fd29e8fc..e0778bd1 100644 --- a/etc/grml/script-functions +++ b/etc/grml/script-functions @@ -157,23 +157,6 @@ isgrmlcd(){ } # }}} -# {{{ filesystems (proc, pts, sys) -mount_proc(){ - check4root || return 1 - [ -f /proc/version ] || mount -t proc /proc /proc 2>/dev/null -} - -mount_pts(){ - check4root || return 1 - stringinfile "/dev/pts" /proc/mounts || mount -t devpts /dev/pts /dev/pts 2>/dev/null -} - -mount_sys(){ - check4root || return 1 - [ -d /sys/devices ] || mount -t sysfs /sys /sys 2>/dev/null -} -# }}} - # char *reverse_list(list) {{{ # # Returns the reversed order of list From 3420bec69a29fcb35f9a04522f5f106c3f95e636 Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Mon, 22 Sep 2025 19:10:57 +0200 Subject: [PATCH 05/11] script-functions: drop unused reverse_list function --- etc/grml/script-functions | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/etc/grml/script-functions b/etc/grml/script-functions index e0778bd1..db63036e 100644 --- a/etc/grml/script-functions +++ b/etc/grml/script-functions @@ -157,25 +157,6 @@ isgrmlcd(){ } # }}} -# char *reverse_list(list) {{{ -# -# Returns the reversed order of list -# -reverse_list() { - local ret - ret='' - while [ "$#" -gt 0 ] ; do - if [ -z "${ret}" ] ; then - ret="$1" - else - ret="$1 ${ret}" - fi - shift - done - printf '%s' "${ret}" -} -#}}} - # bool is_older_than(reference, files/dirs to check) {{{ # # return 0 if any of the files/dirs are newer than From a8b35fd94361fd1324fe02d3116e00a56af00764 Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Mon, 22 Sep 2025 19:11:17 +0200 Subject: [PATCH 06/11] script-functions: drop unused is_older_than function --- etc/grml/script-functions | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/etc/grml/script-functions b/etc/grml/script-functions index db63036e..c4c0af5f 100644 --- a/etc/grml/script-functions +++ b/etc/grml/script-functions @@ -157,28 +157,5 @@ isgrmlcd(){ } # }}} -# bool is_older_than(reference, files/dirs to check) {{{ -# -# return 0 if any of the files/dirs are newer than -# the reference file -# -# EXAMPLE: if is_older_than a.out *.o ; then ... -is_older_than() { - local x - local ref="$1" - shift - - for x in "$@" ; do - [ "${x}" -nt "${ref}" ] && return 0 - - if [ -d "${x}" ] ; then - is_older_than "${ref}" "${x}"/* && return 0 - fi - done - - return 1 -} -#}}} - ## END OF FILE ################################################################# # vim:foldmethod=marker tw=80 ai expandtab shiftwidth=2 tabstop=8 ft=sh From efd91626907e028e73bff48fcc93a123d29562e1 Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Mon, 22 Sep 2025 19:11:53 +0200 Subject: [PATCH 07/11] script-functions: drop unused setpath function --- etc/grml/script-functions | 6 ------ 1 file changed, 6 deletions(-) diff --git a/etc/grml/script-functions b/etc/grml/script-functions index c4c0af5f..1adc03a6 100644 --- a/etc/grml/script-functions +++ b/etc/grml/script-functions @@ -5,12 +5,6 @@ # License: This file is licensed under the GPL v2. ################################################################################ -# {{{ set default PATH -setpath(){ - export PATH=${PATH:-'/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/usr/local/bin'} -} -# }}} - # {{{ check for root-permissions check4root(){ if [ "$(id -u 2>/dev/null)" != 0 ] ; then From c7940d9519032c4594cbd9af321349e5254e0055 Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Mon, 22 Sep 2025 19:12:07 +0200 Subject: [PATCH 08/11] script-functions: drop unused check4user function --- etc/grml/script-functions | 8 -------- 1 file changed, 8 deletions(-) diff --git a/etc/grml/script-functions b/etc/grml/script-functions index 1adc03a6..24480d6b 100644 --- a/etc/grml/script-functions +++ b/etc/grml/script-functions @@ -13,14 +13,6 @@ check4root(){ } # }}} -# {{{ check for user permissions -check4user(){ - if [ "$(id -u 2>/dev/null)" = 0 ] ; then - echo 1>&2 "Error: please do not run this script with uid 0 (root)." ; return 1 - fi -} -# }}} - # {{{ check for running zsh iszsh(){ if ! [ -z "$ZSH_VERSION" ] ; then From 264847e63b6ac2f75cc1f1d67453841345c6b2e8 Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Mon, 22 Sep 2025 19:12:20 +0200 Subject: [PATCH 09/11] script-functions: drop unused iszsh function --- etc/grml/script-functions | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/etc/grml/script-functions b/etc/grml/script-functions index 24480d6b..a06abaf1 100644 --- a/etc/grml/script-functions +++ b/etc/grml/script-functions @@ -13,16 +13,6 @@ check4root(){ } # }}} -# {{{ check for running zsh -iszsh(){ - if ! [ -z "$ZSH_VERSION" ] ; then - return 0 - else - return 1 - fi -} -# }}} - # {{{ check for (X)dialog setdialog(){ if [ -n "$DISPLAY" ] ; then From 51b36c5532ad7fa3a093291d8dc3698a05f4f03d Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Mon, 22 Sep 2025 19:12:33 +0200 Subject: [PATCH 10/11] script-functions: drop unused setdialog function --- etc/grml/script-functions | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/etc/grml/script-functions b/etc/grml/script-functions index a06abaf1..35550bee 100644 --- a/etc/grml/script-functions +++ b/etc/grml/script-functions @@ -13,16 +13,6 @@ check4root(){ } # }}} -# {{{ check for (X)dialog -setdialog(){ - if [ -n "$DISPLAY" ] ; then - [ -x /usr/bin/Xdialog ] && DIALOG="Xdialog" && export XDIALOG_HIGH_DIALOG_COMPAT=1 - else - [ -x /usr/bin/dialog ] && DIALOG='dialog' || ( echo 1>&2 "dialog not available" ; return 1 ) - fi -} -# }}} - # {{{ check for availability of program(s) # usage example: # check4progs [-s,-q,--quiet,--silent] arg [arg .... argn] From 954505eb473ff394dddd341eeb68855fc7b01af0 Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Mon, 22 Sep 2025 19:16:32 +0200 Subject: [PATCH 11/11] script-functions: drop unused checkvalue function --- etc/grml/script-functions | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/etc/grml/script-functions b/etc/grml/script-functions index 35550bee..8e8dcd5c 100644 --- a/etc/grml/script-functions +++ b/etc/grml/script-functions @@ -103,16 +103,6 @@ checkbootparam(){ } # }}} -# {{{ check whether $1 is yes -checkvalue(){ - if [ "$1" = "yes" -o "$1" = "YES" ] ; then - return 0 - else - return 1 - fi -} -# }}} - # {{{ grml specific checks isgrml(){ [ -f /etc/grml_version ] && return 0 || return 1