From 06d7ec6b13af05465b2d88998be2bfbe7c3c43d6 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Sat, 9 Sep 2017 12:08:16 -0700 Subject: [PATCH] fix some minor bugs --- README | 4 ++-- faiserver-setup | 4 ++-- myfai-chboot-local | 15 +++++++++++++-- pxe-server | 2 +- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/README b/README index 72669bb..3c9b6d2 100644 --- a/README +++ b/README @@ -55,8 +55,8 @@ fai-redep # Deploy fai configuration to host "faiserver" faiserver-revm # using pxe & preseed, create a vm which is a fai server faiserver-uninstall # uninstall fai-server faiserver-setup # install fai-server on the current machine -myfai-chboot # setup fai tftp and nfs. useful with pxe-kexec -pxe-server # disable/enable pxe dhcp, tfp, and nfs +myfai-chboot # setup fai tftp and nfs. useful for doing pxe-kexec +pxe-server # disable/enable pxe dhcp, tfp, and nfs. calls myfai-chboot wrt-setup-remote # setup my router in general: dhcp, dns, etc. diff --git a/faiserver-setup b/faiserver-setup index 69e783b..0bf61ca 100755 --- a/faiserver-setup +++ b/faiserver-setup @@ -147,14 +147,14 @@ fi # tried out a stretch base, doesn't work yet. # $sed -f - /etc/fai/nfsroot.conf <&2' ERR + fai_action_arg=I fai_reboot_arg=,reboot @@ -18,7 +21,13 @@ esac [[ $EUID == 0 ]] || exec sudo "${BASH_SOURCE}" "$@" -e() { echo "$@"; "$@"; } +e() { + echo "$*" + if ! "$@"; then + echo "$0: error: exit code $? from: $*" + exit 1 + fi +} host=$1 @@ -38,6 +47,8 @@ fi my_ip=${network%/*} if [[ $host == default ]]; then ip=$network +elif [[ $host == [0-9]*.[0-9]*.[0-9]*.[0-9]* ]]; then + ip=$host else ip=$(host $host | sed -rn 's/^\S+ has address //p;T;q')/32 fi diff --git a/pxe-server b/pxe-server index 8b3399e..63373e3 100755 --- a/pxe-server +++ b/pxe-server @@ -45,7 +45,7 @@ TYPE One of arch, plain, fai. for os boot. Sometimes on debian, there is a 3rd one shortly after the 2nd. I can't remember exactly why this caused a problem, but I'm hoping the sleep will take care of it. --S Pass -S to fai-chboot. +-S sets FAI_ACTION=sysinfo, see myfai-chboot for more info. -w Setup pxe, then wait like -a. -h|--help Print help and exit -- 2.30.2