3 # Setup dhcp server to point to tftp server,
4 # and depending on the type, setup the tftp server.
7 # default distro is the base debian/fedora type. others are fai & arch.
8 # for no pxe server, use a no-op like : or true.
11 trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR
16 Usage: ${0##*/} [OPTIONS] TYPE [HOST]
19 TYPE is one of arch, plain, fai, or : for no pxe server.
20 HOST makes the pxe server only for that specific host
22 -h|--help Print help and exit
23 -- Subsequent arguments are never treated as options
28 ##### begin command line parsing ########
36 *) args
+=("$1"); shift ;;
42 read type host <<<"${args[@]}"
44 if [[ ! $type ]]; then
45 echo "$0: error: exptected 1 argument of type"
53 ##### end command line parsing ########
58 dhcp-option-force=209,boot/syslinux/archiso.cfg
59 dhcp-option-force=210,/arch/
60 dhcp-boot=${host_tag}/arch/boot/syslinux/lpxelinux.0
65 # if arch was used before, this additionally needs
66 # the tftp link in /mnt/usb to be changed.
69 tftp-root=/mnt/usb/tftpboot
70 dhcp-boot=${host_tag}pxelinux.0
77 dhcp-boot=${host_tag}fai/pxelinux.0,faiserver.lan,faiserver.lan
82 $type |
ssh wrt
"cedit pxe-server /etc/dnsmasq.conf || /etc/init.d/dnsmasq restart
83 if [[ $type == arch ]]; then arch-pxe-mount; fi"