+usage() {
+ cat <<EOF
+Usage: ${0##*/} [OPTIONS] HOST
+distro setup full using fai. (assuming we already synced data files to the host)
+
+--no-r Don't ssh to host and reboot.
+-k ssh to host and kexec, don't use pxe. implies --no-r
+-h|--help Print help and exit.
+
+Note: Uses GNU getopt options parsing style
+EOF
+ exit $1
+}
+
+##### begin command line parsing ########
+
+reboot=true
+kexec=false
+temp=$(getopt -l help,no-r hk "$@") || usage 1
+eval set -- "$temp"
+while true; do
+ case $1 in
+ --no-r) reboot=false; shift ;;
+ -k) kexec=true; reboot=false; shift ;;
+ -h|--help) usage ;;
+ --) shift; break ;;
+ *) echo "$0: Internal error!" ; exit 1 ;;
+ esac
+done