From 923571b4c709bfefeb51610392845c5d6316cdc0 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Tue, 30 Jul 2024 21:33:26 +0200 Subject: [PATCH] rename APPNAME to BASENAME --- usr/bin/archboot-binary-check.sh | 3 +-- usr/bin/archboot-copy-mountpoint.sh | 4 ++-- usr/bin/archboot-fw-check.sh | 3 +-- usr/bin/archboot-hwsim.sh | 3 +-- usr/bin/archboot-restore-usbstick.sh | 4 ++-- usr/bin/archboot-rsync-backup.sh | 4 ++-- usr/bin/archboot-server-update.sh | 3 +-- usr/bin/archboot-testsuite.sh | 4 +--- 8 files changed, 11 insertions(+), 17 deletions(-) diff --git a/usr/bin/archboot-binary-check.sh b/usr/bin/archboot-binary-check.sh index 352ef2090..986859f8e 100755 --- a/usr/bin/archboot-binary-check.sh +++ b/usr/bin/archboot-binary-check.sh @@ -2,14 +2,13 @@ # SPDX-License-Identifier: GPL-3.0-or-later # created by Tobias Powalowski . /usr/lib/archboot/common.sh -_APPNAME=${0##*/} _usage () { echo "Check on missing binaries in archboot environment" echo "-------------------------------------------------" echo "This will check binaries from package, if they exist" echo "and report missing to binary.log" echo "" - echo "usage: ${_APPNAME} " + echo "usage: ${_BASENAME} " exit 0 } [[ -z "${1}" ]] && _usage diff --git a/usr/bin/archboot-copy-mountpoint.sh b/usr/bin/archboot-copy-mountpoint.sh index a158b1272..4cea5b706 100755 --- a/usr/bin/archboot-copy-mountpoint.sh +++ b/usr/bin/archboot-copy-mountpoint.sh @@ -5,7 +5,7 @@ # by Tobias Powalowski # usage(exitvalue) # outputs a usage message and exits with value -_APPNAME=${0##*/} +. /usr/lib/archboot/common.sh _usage() { echo -e "\e[1mWelcome to \e[36mARCHBOOT\e[m\e[1m - COPY MOUNTPOINT:\e[m" @@ -15,7 +15,7 @@ _usage() echo -e "- For system copying start with mounted \e[1m/\e[m and then invoke this script" echo -e " for each additional mountpoint eg. \e[1m/boot\e[m or \e[1m/home\e[m." echo "" - echo -e "usage: \e[1m${_APPNAME} \e[m" + echo -e "usage: \e[1m${_BASENAME} \e[m" exit 0 } ################################################## diff --git a/usr/bin/archboot-fw-check.sh b/usr/bin/archboot-fw-check.sh index 1b414b77f..2af7ea8b2 100755 --- a/usr/bin/archboot-fw-check.sh +++ b/usr/bin/archboot-fw-check.sh @@ -2,7 +2,6 @@ # SPDX-License-Identifier: GPL-3.0-or-later # created by Tobias Powalowski . /usr/lib/archboot/common.sh -_APPNAME=${0##*/} _MODULE_DIR="/usr/lib/modules/${_RUNNING_KERNEL}" _FIRMWARE="/lib/firmware" _usage () { @@ -10,7 +9,7 @@ _usage () { echo -e "\e[1m---------------------------------------------------------------\e[m" echo "Check modules on firmware depends and existence in environment." echo "" - echo -e "usage: \e[1m${_APPNAME} run\e[m" + echo -e "usage: \e[1m${_BASENAME} run\e[m" exit 0 } [[ -z "${1}" || "${1}" != "run" ]] && _usage diff --git a/usr/bin/archboot-hwsim.sh b/usr/bin/archboot-hwsim.sh index 15bed34e1..251ebd013 100755 --- a/usr/bin/archboot-hwsim.sh +++ b/usr/bin/archboot-hwsim.sh @@ -6,7 +6,6 @@ # usage(exitvalue) # outputs a usage message and exits with value . /usr/lib/archboot/common.sh -_APPNAME=${0##*/} _usage() { echo -e "\e[1mWelcome to \e[34marchboot's\e[m \e[1mHWSIM:\e[m" @@ -16,7 +15,7 @@ _usage() echo "- wlan0 will be setup as the AP. Don't use for scanning!" echo "- wlan1 will be setup for STATION mode. Use this for scanning for your AP." echo "" - echo -e "usage: \e[1m${_APPNAME} \e[m" + echo -e "usage: \e[1m${_BASENAME} \e[m" exit 0 } [[ -z "${1}" ]] && _usage diff --git a/usr/bin/archboot-restore-usbstick.sh b/usr/bin/archboot-restore-usbstick.sh index 4df969960..64c62e2c4 100755 --- a/usr/bin/archboot-restore-usbstick.sh +++ b/usr/bin/archboot-restore-usbstick.sh @@ -5,7 +5,7 @@ # by Tobias Powalowski # usage(exitvalue) # outputs a usage message and exits with value -_APPNAME=${0##*/} +. /usr/lib/archboot/common.sh _usage() { echo -e "\e[1mWelcome to \e[36mARCHBOOT\e[m \e[1m- RESTORE USB STICK:\e[m" @@ -13,7 +13,7 @@ _usage() echo -e "This script restores an USB device to a \e[1mFAT32\e[m device." echo -e "\e[91mWARNING: ALL DATA WILL BE LOST ON THE DEVICE! \e[m" echo "" - echo -e "usage: \e[1m${_APPNAME} \e[m" + echo -e "usage: \e[1m${_BASENAME} \e[m" exit 0 } ################################################## diff --git a/usr/bin/archboot-rsync-backup.sh b/usr/bin/archboot-rsync-backup.sh index 440943c23..3fa1baaa4 100755 --- a/usr/bin/archboot-rsync-backup.sh +++ b/usr/bin/archboot-rsync-backup.sh @@ -4,7 +4,7 @@ # by Tobias Powalowski # usage(exitvalue) # outputs a usage message and exits with value -_APPNAME=${0##*/} +. /usr/lib/archboot/common.sh _usage() { echo -e "\e[1mWelcome to \e[36mARCHBOOT\e[m\e[1m - RSYNC BACKUP:\e[m" @@ -16,7 +16,7 @@ _usage() echo -e " \e[1mexcluded\e[m \e[1m/sysroot /var/run /var/lib/systemd\e[m" echo -e "- \e[1m--numeric-ids\e[m option is invoked to \e[1mpreserve\e[m users" echo "" - echo -e "usage: \e[1m${_APPNAME} \e[m" + echo -e "usage: \e[1m${_BASENAME} \e[m" exit 0 } ################################################## diff --git a/usr/bin/archboot-server-update.sh b/usr/bin/archboot-server-update.sh index 07d3a0786..afd065c4c 100755 --- a/usr/bin/archboot-server-update.sh +++ b/usr/bin/archboot-server-update.sh @@ -1,7 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: GPL-3.0-or-later # created by Tobias Powalowski -_APPNAME=${0##*/} . /etc/archboot/defaults . /etc/archboot/server-update.conf . /usr/lib/archboot/common.sh @@ -10,7 +9,7 @@ _usage () { echo -e "\e[1m---------------------------------------------\e[m" echo "Check on new packages and release new images to server." echo "" - echo -e "usage: \e[1m${_APPNAME} run\e[m" + echo -e "usage: \e[1m${_BASENAME} run\e[m" exit 0 } [[ -z "${1}" || "${1}" != "run" ]] && _usage diff --git a/usr/bin/archboot-testsuite.sh b/usr/bin/archboot-testsuite.sh index 04cad0e23..cd1f7eeb0 100755 --- a/usr/bin/archboot-testsuite.sh +++ b/usr/bin/archboot-testsuite.sh @@ -2,8 +2,6 @@ # SPDX-License-Identifier: GPL-3.0-or-later # created by Tobias Powalowski . /usr/lib/archboot/common.sh -_LOG="/dev/tty11" -_APPNAME=${0##*/} _LOOP="/dev/loop0" _IMG="/test.img" _PASS="/passphrase" @@ -12,7 +10,7 @@ _usage () { echo -e "\e[1m---------------------------------------------\e[m" echo "Run automatic tests to detect errors/changes." echo "" - echo -e "usage: \e[1m${_APPNAME} run\e[m" + echo -e "usage: \e[1m${_BASENAME} run\e[m" exit 0 } _run_test () {