summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-09-16 16:29:49 -0300
committerRenato Botelho <renato@netgate.com>2016-09-16 16:29:49 -0300
commit6656b888e8dfd4b5c6d5f10991e001512a4eba41 (patch)
treee761119e3dad94d2f26bb334560a5d24355a84e6
parentd5be878f8053cd91c8d736ae1136610af1a8d26d (diff)
downloadpfsense-6656b888e8dfd4b5c6d5f10991e001512a4eba41.zip
pfsense-6656b888e8dfd4b5c6d5f10991e001512a4eba41.tar.gz
Add 'now' parameter do do_reboot() to force it to happen immediately
-rwxr-xr-xsrc/usr/local/sbin/pfSense-upgrade21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/usr/local/sbin/pfSense-upgrade b/src/usr/local/sbin/pfSense-upgrade
index 394e6cb..9838fb0 100755
--- a/src/usr/local/sbin/pfSense-upgrade
+++ b/src/usr/local/sbin/pfSense-upgrade
@@ -677,12 +677,25 @@ pkg_delete_all() {
}
do_reboot() {
+ local _now="$1"
+
+ local _msg=""
+ if [ "${_now}" = "now" ]; then
+ _msg="now."
+ else
+ _msg="in ${reboot_after} seconds."
+ fi
+
if [ -z "${dont_reboot}" ]; then
- _echo "Upgrade is complete. Rebooting in ${reboot_after} seconds."
- echo "Upgrade is complete. Rebooting in ${reboot_after} seconds." | wall
- /etc/rc.notify_message -e -g -m "Upgrade is complete. Rebooting in ${reboot_after} seconds." \
+ _echo "Upgrade is complete. Rebooting ${_msg}"
+ echo "Upgrade is complete. Rebooting ${_msg}" | wall
+ /etc/rc.notify_message -e -g -m "Upgrade is complete. Rebooting ${_msg}" \
>/dev/null 2>&1
- (sleep ${reboot_after} && /etc/rc.reboot) &
+ if [ "${_now}" = "now" ]; then
+ /etc/rc.reboot
+ else
+ (sleep ${reboot_after} && /etc/rc.reboot) &
+ fi
else
_echo "Upgrade is complete."
echo "Upgrade is complete." | wall
OpenPOWER on IntegriCloud