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]
-Sets up tftp pxe config. No argument disables for all hosts.
+Sets up tftp pxe config and nfs config on host "faiserver". Argument
+sets the host to enable it for. No argument disables pxe config for all
+hosts, but leaves nfs server alone. Use faiserver-disable to disable
+the nfs server.
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