From bf19e9969f50a637c8fabf724eb9e292da472e01 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Wed, 7 Sep 2016 01:20:14 -0700 Subject: [PATCH] cleanup docs, getopt arg parsing --- arch-init-remote | 9 ++++++++- chboot | 30 +++++++++++++++++++++++------- dsfull | 3 +++ fai-revm | 44 ++++++++++++++++++++++++++++++++++++-------- faiserver-revm | 2 ++ fresize | 12 ++++++++---- pxe-server | 18 ++++++++++-------- wrt-setup-remote | 3 +++ 8 files changed, 93 insertions(+), 28 deletions(-) diff --git a/arch-init-remote b/arch-init-remote index 770e332..5bcfc3b 100755 --- a/arch-init-remote +++ b/arch-init-remote @@ -15,6 +15,13 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +usage() { + cat <&2' ERR if [[ ! $1 ]]; then echo "error: expect a hostname in \$1 " - exit 1 + usage 1 fi host=$1 diff --git a/chboot b/chboot index 925becc..426fd9a 100755 --- a/chboot +++ b/chboot @@ -15,25 +15,41 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# Set grub to boot into a different distro, and reboot unless -r -# $0 [DISTRO_NAME] -# with no argument, print available distros - -# DISTRO_NAME is based on the partition names in /boot. eg boot_debianjessie set -eE -o pipefail trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR [[ $EUID == 0 ]] || exec sudo "$BASH_SOURCE" "$@" +usage() { + cat <&2' ERR -- 2.30.2