add host
[automated-distro-installer] / myfai-chboot
index 32addc589e4f2a2b9455ec4d48b47ff39c5dc40c..11c3eae30cb7b22db5cd9b67826f773e4a72d5c0 100755 (executable)
@@ -3,22 +3,22 @@
 set -eE -o pipefail
 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
 
+x=$(readlink -f "$BASH_SOURCE"); cd ${x%/*}
 
 usage() {
-    cat <<'EOF'
-usage $0 [hostname|ip|default]...
+    cat <<EOF
+usage: ${0##*/} [-h|--help] [hostname|ip|default]...
 
-Sets up tftp pxe config. No argument disables for all hosts.
+Sets up tftp pxe config on host "faiserver". Argument sets the host to
+enable it for, "default" is for all hosts.  No argument disables for all
+hosts.
 EOF
     exit $1
 }
+case $1 in
+    -h|--help) usage ;;
+esac
 
-cd "${BASH_SOURCE%/*}" # directory of the script
 
 host=$(chost faiserver)
 ssh root@$host bash -s "$@" <myfai-chboot-local
-if [[ $1 ]]; then
-    ./faiserver-enable
-else
-    ./faiserver-disable
-fi