diff --git a/Makefile b/Makefile index 748068b9c..696bf9e72 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,10 @@ umount: umount -f ":${.CURDIR}/src" install: - mkdir -p ${DESTDIR}/usr/local - cp -r ${.CURDIR}/src/* ${DESTDIR}/usr/local + @mkdir -p ${DESTDIR}/usr/local + @cp -r ${.CURDIR}/src/* ${DESTDIR}/usr/local + @(cd ${.CURDIR}/src; find * -type f) | \ + xargs -n1 printf "/usr/local/%s\n" lint: find ${.CURDIR}/src -name "*.class" -print0 | xargs -0 -n1 php -l diff --git a/src/opnsense/scripts/pkg_upgrade.sh b/src/opnsense/scripts/pkg_upgrade.sh index cfa0931cf..7c6ec3e83 100755 --- a/src/opnsense/scripts/pkg_upgrade.sh +++ b/src/opnsense/scripts/pkg_upgrade.sh @@ -1,5 +1,17 @@ #!/bin/sh -pkg upgrade -y > /tmp/pkg_upgrade.progress & -echo '***DONE***' >> /tmp/pkg_upgrade.progress -rm /tmp/pkg_upgrade.progress + +pkg_running=`ps -x | grep "pkg " | grep -v "grep"` +if [ "$pkg_running" == "" ]; then + if [ -f /tmp/pkg_upgrade.progress ]; then + # Remove leftovers from previous upgrade first + rm /tmp/pkg_upgrade.progress + fi + # start pkg upgrade + pkg upgrade -y > /tmp/pkg_upgrade.progress + echo '***DONE***' >> /tmp/pkg_upgrade.progress +else + echo 'Upgrade already in progress' + echo '***DONE***' +fi + diff --git a/src/www/system_firmware_check.php b/src/www/system_firmware_check.php index 306e98d49..892ada9c5 100644 --- a/src/www/system_firmware_check.php +++ b/src/www/system_firmware_check.php @@ -52,7 +52,7 @@ if($_POST['action'] == 'pkg_upgrade') { $shell_output = array(); $shell = new 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&",false,false,$shell_output); } if($_POST['action'] == 'update_status' ) {