+}
+
+set-pxe() {
+ ${1:-$type} | ssh wrt "cedit pxe-server /etc/dnsmasq.conf || /etc/init.d/dnsmasq restart
+if [[ $type == arch ]]; then arch-pxe-mount; fi"
+}
+
+set-pxe
+
+if [[ $type == fai ]]; then
+ if $redep; then
+ fai-redep
+ fi
+ faiserver-enable
+fi
+
+if ! $persist; then
+ echo "waiting for 2 dhcp acks then disabling pxe"
+ ack-wait 2
+ set-pxe :
+ if [[ $type == fai ]]; then
+ # fai server can contain sensitive info, so turn it off
+ # when it's not in use.
+ echo "waiting for 1 dhcp ack then disabling fai server"
+ ack-wait 1
+ faiserver-disable
+ fi