rename APPNAME to BASENAME

This commit is contained in:
Tobias Powalowski 2024-07-30 21:33:26 +02:00
parent 2362a59146
commit 923571b4c7
8 changed files with 11 additions and 17 deletions

View file

@ -2,14 +2,13 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
# created by Tobias Powalowski <tpowa@archlinux.org> # created by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/common.sh . /usr/lib/archboot/common.sh
_APPNAME=${0##*/}
_usage () { _usage () {
echo "Check on missing binaries in archboot environment" echo "Check on missing binaries in archboot environment"
echo "-------------------------------------------------" echo "-------------------------------------------------"
echo "This will check binaries from package, if they exist" echo "This will check binaries from package, if they exist"
echo "and report missing to binary.log" echo "and report missing to binary.log"
echo "" echo ""
echo "usage: ${_APPNAME} <package>" echo "usage: ${_BASENAME} <package>"
exit 0 exit 0
} }
[[ -z "${1}" ]] && _usage [[ -z "${1}" ]] && _usage

View file

@ -5,7 +5,7 @@
# by Tobias Powalowski <tpowa@archlinux.org> # by Tobias Powalowski <tpowa@archlinux.org>
# usage(exitvalue) # usage(exitvalue)
# outputs a usage message and exits with value # outputs a usage message and exits with value
_APPNAME=${0##*/} . /usr/lib/archboot/common.sh
_usage() _usage()
{ {
echo -e "\e[1mWelcome to \e[36mARCHBOOT\e[m\e[1m - COPY MOUNTPOINT:\e[m" 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 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 -e " for each additional mountpoint eg. \e[1m/boot\e[m or \e[1m/home\e[m."
echo "" echo ""
echo -e "usage: \e[1m${_APPNAME} <oldmountpoint> <newmountpoint>\e[m" echo -e "usage: \e[1m${_BASENAME} <oldmountpoint> <newmountpoint>\e[m"
exit 0 exit 0
} }
################################################## ##################################################

View file

@ -2,7 +2,6 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
# created by Tobias Powalowski <tpowa@archlinux.org> # created by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/common.sh . /usr/lib/archboot/common.sh
_APPNAME=${0##*/}
_MODULE_DIR="/usr/lib/modules/${_RUNNING_KERNEL}" _MODULE_DIR="/usr/lib/modules/${_RUNNING_KERNEL}"
_FIRMWARE="/lib/firmware" _FIRMWARE="/lib/firmware"
_usage () { _usage () {
@ -10,7 +9,7 @@ _usage () {
echo -e "\e[1m---------------------------------------------------------------\e[m" echo -e "\e[1m---------------------------------------------------------------\e[m"
echo "Check modules on firmware depends and existence in environment." echo "Check modules on firmware depends and existence in environment."
echo "" echo ""
echo -e "usage: \e[1m${_APPNAME} run\e[m" echo -e "usage: \e[1m${_BASENAME} run\e[m"
exit 0 exit 0
} }
[[ -z "${1}" || "${1}" != "run" ]] && _usage [[ -z "${1}" || "${1}" != "run" ]] && _usage

View file

@ -6,7 +6,6 @@
# usage(exitvalue) # usage(exitvalue)
# outputs a usage message and exits with value # outputs a usage message and exits with value
. /usr/lib/archboot/common.sh . /usr/lib/archboot/common.sh
_APPNAME=${0##*/}
_usage() _usage()
{ {
echo -e "\e[1mWelcome to \e[34marchboot's\e[m \e[1mHWSIM:\e[m" 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 "- 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 "- wlan1 will be setup for STATION mode. Use this for scanning for your AP."
echo "" echo ""
echo -e "usage: \e[1m${_APPNAME} <SSID>\e[m" echo -e "usage: \e[1m${_BASENAME} <SSID>\e[m"
exit 0 exit 0
} }
[[ -z "${1}" ]] && _usage [[ -z "${1}" ]] && _usage

View file

@ -5,7 +5,7 @@
# by Tobias Powalowski <tpowa@archlinux.org> # by Tobias Powalowski <tpowa@archlinux.org>
# usage(exitvalue) # usage(exitvalue)
# outputs a usage message and exits with value # outputs a usage message and exits with value
_APPNAME=${0##*/} . /usr/lib/archboot/common.sh
_usage() _usage()
{ {
echo -e "\e[1mWelcome to \e[36mARCHBOOT\e[m \e[1m- RESTORE USB STICK:\e[m" 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 "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 -e "\e[91mWARNING: ALL DATA WILL BE LOST ON THE DEVICE! \e[m"
echo "" echo ""
echo -e "usage: \e[1m${_APPNAME} <device>\e[m" echo -e "usage: \e[1m${_BASENAME} <device>\e[m"
exit 0 exit 0
} }
################################################## ##################################################

View file

@ -4,7 +4,7 @@
# by Tobias Powalowski <tpowa@archlinux.org> # by Tobias Powalowski <tpowa@archlinux.org>
# usage(exitvalue) # usage(exitvalue)
# outputs a usage message and exits with value # outputs a usage message and exits with value
_APPNAME=${0##*/} . /usr/lib/archboot/common.sh
_usage() _usage()
{ {
echo -e "\e[1mWelcome to \e[36mARCHBOOT\e[m\e[1m - RSYNC BACKUP:\e[m" 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[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 -e "- \e[1m--numeric-ids\e[m option is invoked to \e[1mpreserve\e[m users"
echo "" echo ""
echo -e "usage: \e[1m${_APPNAME} <backupdir> <backupdestination>\e[m" echo -e "usage: \e[1m${_BASENAME} <backupdir> <backupdestination>\e[m"
exit 0 exit 0
} }
################################################## ##################################################

View file

@ -1,7 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
# created by Tobias Powalowski <tpowa@archlinux.org> # created by Tobias Powalowski <tpowa@archlinux.org>
_APPNAME=${0##*/}
. /etc/archboot/defaults . /etc/archboot/defaults
. /etc/archboot/server-update.conf . /etc/archboot/server-update.conf
. /usr/lib/archboot/common.sh . /usr/lib/archboot/common.sh
@ -10,7 +9,7 @@ _usage () {
echo -e "\e[1m---------------------------------------------\e[m" echo -e "\e[1m---------------------------------------------\e[m"
echo "Check on new packages and release new images to server." echo "Check on new packages and release new images to server."
echo "" echo ""
echo -e "usage: \e[1m${_APPNAME} run\e[m" echo -e "usage: \e[1m${_BASENAME} run\e[m"
exit 0 exit 0
} }
[[ -z "${1}" || "${1}" != "run" ]] && _usage [[ -z "${1}" || "${1}" != "run" ]] && _usage

View file

@ -2,8 +2,6 @@
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
# created by Tobias Powalowski <tpowa@archlinux.org> # created by Tobias Powalowski <tpowa@archlinux.org>
. /usr/lib/archboot/common.sh . /usr/lib/archboot/common.sh
_LOG="/dev/tty11"
_APPNAME=${0##*/}
_LOOP="/dev/loop0" _LOOP="/dev/loop0"
_IMG="/test.img" _IMG="/test.img"
_PASS="/passphrase" _PASS="/passphrase"
@ -12,7 +10,7 @@ _usage () {
echo -e "\e[1m---------------------------------------------\e[m" echo -e "\e[1m---------------------------------------------\e[m"
echo "Run automatic tests to detect errors/changes." echo "Run automatic tests to detect errors/changes."
echo "" echo ""
echo -e "usage: \e[1m${_APPNAME} run\e[m" echo -e "usage: \e[1m${_BASENAME} run\e[m"
exit 0 exit 0
} }
_run_test () { _run_test () {