From c8871daa0786fe76df657c318e7596a1cc94a66e Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 21 Jan 2025 15:49:07 +0100 Subject: [PATCH] installer: allow halting after install PR: https://github.com/opnsense/installer/issues/20 --- src/sbin/opnsense-installer | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/sbin/opnsense-installer b/src/sbin/opnsense-installer index c1a11c898..46ae3ae07 100755 --- a/src/sbin/opnsense-installer +++ b/src/sbin/opnsense-installer @@ -29,16 +29,25 @@ if [ "$(id -u)" != "0" ]; then exit 1 fi -if ! bsdinstall opnsense; then - clear - exit 0 -fi +bsdinstall opnsense + +RET=${?} clear +ACTION=Rebooting +FINAL=reboot + +if [ ${RET} -eq 0 ]; then + exit 0 +elif [ ${RET} -eq 42 ]; then + ACTION=Halting + FINAL="halt -p" +fi + echo "The installation finished successfully." echo -echo "After reboot, open a web browser and navigate to" +echo "After booting, open a web browser and navigate to" echo "https://192.168.1.1 (or the LAN IP address). The console" echo "can also be used to set a different LAN IP." echo @@ -56,4 +65,4 @@ done echo -reboot +${FINAL}