diff --git a/src/opnsense/scripts/pkg_upgrade.sh b/src/opnsense/scripts/pkg_upgrade.sh index 857ab7b9d..354bf7678 100755 --- a/src/opnsense/scripts/pkg_upgrade.sh +++ b/src/opnsense/scripts/pkg_upgrade.sh @@ -1,5 +1,29 @@ #!/bin/sh +# Copyright (C) 2014 Deciso B.V. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY +# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +# OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + pkg_running=`ps -x | grep "pkg " | grep -v "grep"` if [ "$pkg_running" == "" ]; then if [ -f /tmp/pkg_upgrade.progress ]; then @@ -7,9 +31,11 @@ if [ "$pkg_running" == "" ]; then rm /tmp/pkg_upgrade.progress fi # start pkg upgrade - pkg upgrade -y > /tmp/pkg_upgrade.progress + echo '***STARTING UPGRADE***' > /tmp/pkg_upgrade.progress + pkg upgrade -y >> /tmp/pkg_upgrade.progress echo '***DONE***' >> /tmp/pkg_upgrade.progress else echo 'Upgrade already in progress' echo '***DONE***' + /usr/local/opnsense/scripts/pkg_updatecheck.sh fi diff --git a/src/www/system_firmware_check.php b/src/www/system_firmware_check.php index 07577b53c..3918c0a7e 100644 --- a/src/www/system_firmware_check.php +++ b/src/www/system_firmware_check.php @@ -50,9 +50,9 @@ if($_POST['action'] == 'pkg_update') { if($_POST['action'] == 'pkg_upgrade') { /* Setup Shell variables */ $shell_output = array(); - $shell = new OPsense\Core\Shell(); + $shell = new OPNsense\Core\Shell(); // execute shell command and collect (only valid) info into named array - $shell->exec("/usr/local/opnsense/scripts/pkg_upgrade.sh&",false,false,$shell_output); + $shell->exec("/usr/local/opnsense/scripts/pkg_upgrade.sh > /dev/null 2 > /dev/null < /dev/null &",false,false,$shell_output); } if($_POST['action'] == 'update_status' ) {