diff options
Diffstat (limited to 'src/usr/local/sbin/pfSense-upgrade')
-rwxr-xr-x | src/usr/local/sbin/pfSense-upgrade | 23 |
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 |