+
+usage() {
+ cat <<EOF
+Usage: ${0##*/} [OPTIONS] TYPE [HOST]
+One line description
+
+TYPE is one of arch, plain, fai, or : for no pxe server.
+HOST makes the pxe server only for that specific host
+
+-r Don't redeploy fai config.
+-a Wait for 2 dhcp acks, then disable the pxe server after a delay.
+ First ack is for pxe boot, 2nd ack is for os boot. Sometimes
+ on debian, there is a 3rd one shortly after the 2nd. I can't remember
+ exactly why this caused a problem, but I'm hoping the sleep
+ will take care of it.
+-w Initially setup pxe, then wait like -a.
+-h|--help Print help and exit
+
+
+Note: Uses GNU getopt options parsing style
+EOF
+ exit $1
+}
+
+##### begin command line parsing ########
+
+args=()
+redep=true
+acks=2
+wait=false
+temp=$(getopt -l help harw "$@") || usage 1
+eval set -- "$temp"
+while true; do
+ case $1 in
+ -a) wait=true; set=false; shift ;;
+ -r) redep=false; shift ;;
+ -w) wait=true; set=true; shift ;;
+ -h|--help) usage ;;
+ --) shift; break ;;
+ *) echo "$0: Internal error!" ; exit 1 ;;
+ esac
+done
+
+read type host <<<"$@"
+
+if [[ ! $type ]]; then