Skip to content

Commit

Permalink
installer: go with this dialog; closes #20
Browse files Browse the repository at this point in the history
  • Loading branch information
fichtner committed Jan 23, 2025
1 parent ae1d9d8 commit be546bb
Showing 1 changed file with 19 additions and 21 deletions.
40 changes: 19 additions & 21 deletions src/opnsense.sh
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ case "${CHOICE}" in
exit 0 # "this is fine"
;;
"Force Halt")
break; # XXX testing spot
exit 42 # "bring a towel"
;;
*)
Expand All @@ -341,26 +340,6 @@ esac

done

powerconfig() {
exec 3>&1
REVISIT=$(dialog --backtitle "OPNsense Installer" \
--title "Installation Complete" --no-cancel --menu \
"Choose how to proceed with this new install.\n
\n
Note: The system may boot back into the installation media when not ejected properly." 0 0 0 \
"Reboot now" "Reboot system" \
"Halt now" "Power down system" 2>&1 1>&3)
exec 3>&-

case "$REVISIT" in
"Halt now")
exit 42 # "bring a towel"
;;
esac
}

powerconfig # XXX testing spot

bsdinstall opnsense-install || error "Failed to install"

# Set up boot loader
Expand Down Expand Up @@ -401,6 +380,25 @@ bsdinstall umount

f_dprintf "Installation Completed at %s" "$( date )"

powerconfig() {
exec 3>&1
REVISIT=$(dialog --backtitle "OPNsense Installer" \
--title "Installation Complete" --no-cancel --menu \
"The system may boot back into the installation media when not ejected properly." 0 0 0 \
"Reboot now" "Reboot system" \
"Halt now" "Power down system" 2>&1 1>&3)
exec 3>&-

case "$REVISIT" in
"Halt now")
exit 42 # "bring a towel"
;;
esac
}

# And we are done!
powerconfig

################################################################################
# END
################################################################################

0 comments on commit be546bb

Please sign in to comment.