f732642dffa0811756e4df8bb79f0ede01ea9d3c
[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 server on host "faiserver".
13
14 If our kernel has no nfs support, uses apache, and depends on another
15 repo of Ian Kelling, basic-https-conf, where the file is at
16 /a/exe/apache-site.
17
18 Usng this, you can boot into fai with pxe-kexec without changing
19 the dhcp server.
20
21 Argument sets the host to enable it for. No argument disables pxe
22 config for all hosts, but leaves nfs server alone. Use faiserver-disable
23 to disable the nfs server.
24
25 EOF
26 exit $1
27 }
28 case $1 in
29 -h|--help) usage ;;
30 esac
31
32
33 host=$(chost faiserver)
34 ssh root@$host bash -s "$@" <myfai-chboot-local