limit fai nfs export to host being installed
[automated-distro-installer] / myfai-chboot
index 1abead8c5922a7feb7bcc1df6c1adcbf9b4e9841..2a6e02590d2a7fc6e59ce50521db6ac44a1dcf91 100755 (executable)
@@ -3,17 +3,23 @@
 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