revert chost, broke for localhost
[automated-distro-installer] / myfai-chboot
1 #!/bin/bash
2
3 set -eE -o pipefail
4 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
5
6 x=$(readlink -f "$BASH_SOURCE"); cd ${x%/*}
7
8 usage() {
9 cat <<EOF
10 usage: ${0##*/} [-h|--help] [hostname|ip]
11
12 Sets up tftp pxe config and nfs config on host "faiserver". Argument
13 sets the host to enable it for. No argument disables pxe config for all
14 hosts, but leaves nfs server alone. Use faiserver-disable to disable
15 the nfs server.
16 EOF
17 exit $1
18 }
19 case $1 in
20 -h|--help) usage ;;
21 esac
22
23
24 host=$(chost faiserver)
25 ssh root@$host bash -s "$@" <myfai-chboot-local