summaryrefslogtreecommitdiffstats
path: root/src/usr/local/sbin
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-01-14 09:06:45 -0200
committerRenato Botelho <renato@netgate.com>2016-01-14 09:06:45 -0200
commit2f1889c9166ffd97b4e64bd9ab4792511e9117ec (patch)
tree6bec1bf96e0b4c2f87ed334ec6806448f07bd65a /src/usr/local/sbin
parent5be76d387ece734171fabe6ae117dabd6eff769f (diff)
downloadpfsense-2f1889c9166ffd97b4e64bd9ab4792511e9117ec.zip
pfsense-2f1889c9166ffd97b4e64bd9ab4792511e9117ec.tar.gz
Change pfSense-upgrade to return time for reboot so GUI can use it
Diffstat (limited to 'src/usr/local/sbin')
-rwxr-xr-xsrc/usr/local/sbin/pfSense-upgrade23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/usr/local/sbin/pfSense-upgrade b/src/usr/local/sbin/pfSense-upgrade
index 2ce7421..536bb45 100755
--- a/src/usr/local/sbin/pfSense-upgrade
+++ b/src/usr/local/sbin/pfSense-upgrade
@@ -147,8 +147,12 @@ _exit() {
local _rc=${1:-"0"}
# If EVENT_PIPE is defined, GUI is calling
- [ -n "${progress_socket}" ] \
- && _echo "__RC=${_rc}"
+ if [ -n "${progress_socket}" ]; then
+ local _need_reboot_str=""
+ [ -n "${need_reboot}" ] \
+ && _need_reboot_str=" __REBOOT_AFTER=${reboot_after}"
+ _echo "__RC=${_rc}${_need_reboot_str}"
+ fi
exit ${_rc}
}
@@ -646,11 +650,15 @@ pkg_reinstall_all() {
}
do_reboot() {
- _echo "Upgrade is complete. Rebooting in 10 seconds."
- echo "Upgrade is complete. Rebooting in 10 seconds." | wall
- /etc/rc.notify_message -e -g -m "Upgrade is complete. Rebooting in 10 seconds."
if [ -z "${dont_reboot}" ]; then
- (sleep 10 && /etc/rc.reboot) &
+ _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."
+ (sleep ${reboot_after} && /etc/rc.reboot) &
+ else
+ _echo "Upgrade is complete."
+ echo "Upgrade is complete." | wall
+ /etc/rc.notify_message -e -g -m "Upgrade is complete."
fi
}
@@ -687,6 +695,9 @@ export chroot_dir=""
# Save nc_pid to be able to kill it
export nc_pid=""
+# Reboot after 10 seconds
+export reboot_after=10
+
unset dry_run
unset dont_reboot
unset booting
OpenPOWER on IntegriCloud