-
Notifications
You must be signed in to change notification settings - Fork 774
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
installer: allow halting after install
PR: opnsense/installer#20 (cherry picked from commit c8871da) (cherry picked from commit c38dbab) (cherry picked from commit 7335db7)
- Loading branch information
Showing
1 changed file
with
29 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/sh | ||
|
||
# Copyright (c) 2014-2021 Franco Fichtner <[email protected]> | ||
# Copyright (c) 2014-2025 Franco Fichtner <[email protected]> | ||
# Copyright (c) 2004-2009 Scott Ullrich <[email protected]> | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
|
@@ -29,25 +29,38 @@ 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 42 ]; then | ||
ACTION="Powering down" | ||
FINAL="halt -p" | ||
elif [ ${RET} -ne 0 ]; then | ||
exit 0 | ||
fi | ||
|
||
echo "The installation finished successfully." | ||
echo | ||
echo "After reboot, 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 | ||
echo "Your browser may report the HTTPS certificate as untrusted" | ||
echo "and ask you to accept it. This is normal, as the default" | ||
echo "certificate will be self-signed and cannot be validated by" | ||
echo "an external root authority." | ||
echo | ||
echo -n "Rebooting in 5 seconds. CTRL-C to abort" | ||
|
||
if [ ${RET} -ne 42 ]; then | ||
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 | ||
echo "Your browser may report the HTTPS certificate as untrusted" | ||
echo "and ask you to accept it. This is normal, as the default" | ||
echo "certificate will be self-signed and cannot be validated by" | ||
echo "an external root authority." | ||
echo | ||
fi | ||
|
||
echo -n "${ACTION} in 5 seconds. CTRL-C to abort" | ||
|
||
for n in 5 4 3 2 1; do | ||
echo -n "." | ||
|
@@ -56,4 +69,4 @@ done | |
|
||
echo | ||
|
||
reboot | ||
${FINAL} |