From 814ee488785621b0886b2d494a726bbeaca0bb4a Mon Sep 17 00:00:00 2001 From: Jos Schellevis Date: Tue, 23 Dec 2014 07:35:20 +0000 Subject: [PATCH 1/4] upgrade script enahncements and now temporary in test mode --- src/opnsense/scripts/pkg_upgrade.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/opnsense/scripts/pkg_upgrade.sh b/src/opnsense/scripts/pkg_upgrade.sh index cfa0931cf..9dd034bf9 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 ] + # Remove leftovers from previous upgrade first + rm /tmp/pkg_upgrade.progress + fi + # start pkg upgrade + pkg upgrade -n > /tmp/pkg_upgrade.progress & # Need to st this to -y for production, now set to -n for testing purpose + echo '***DONE***' >> /tmp/pkg_upgrade.progress +else + echo 'Upgrade already in progress' + echo '***DONE***' +fi + From a2e63b70aa45d530ffa6c5cc009a6c006ebe893e Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Tue, 23 Dec 2014 11:37:27 +0000 Subject: [PATCH 2/4] Firmware upgrade is now fully functional --- src/opnsense/scripts/pkg_upgrade.sh | 4 ++-- src/www/system_firmware_check.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/opnsense/scripts/pkg_upgrade.sh b/src/opnsense/scripts/pkg_upgrade.sh index 9dd034bf9..7d3cd6e89 100755 --- a/src/opnsense/scripts/pkg_upgrade.sh +++ b/src/opnsense/scripts/pkg_upgrade.sh @@ -2,12 +2,12 @@ pkg_running=`ps -x | grep "pkg " | grep -v "grep"` if [ "$pkg_running" == "" ]; then - if [ -f /tmp/pkg_upgrade.progress ] + if [ -f /tmp/pkg_upgrade.progress ]; then # Remove leftovers from previous upgrade first rm /tmp/pkg_upgrade.progress fi # start pkg upgrade - pkg upgrade -n > /tmp/pkg_upgrade.progress & # Need to st this to -y for production, now set to -n for testing purpose + pkg upgrade -y > /tmp/pkg_upgrade.progress & echo '***DONE***' >> /tmp/pkg_upgrade.progress else echo 'Upgrade already in progress' diff --git a/src/www/system_firmware_check.php b/src/www/system_firmware_check.php index 306e98d49..851150758 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' ) { From eb136be2ad1749c34e90994e6b85eb3e33d1501b Mon Sep 17 00:00:00 2001 From: Charlie Root Date: Tue, 23 Dec 2014 11:47:16 +0000 Subject: [PATCH 3/4] Small fix for background process pkg_upgrade --- src/opnsense/scripts/pkg_upgrade.sh | 2 +- src/www/system_firmware_check.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/opnsense/scripts/pkg_upgrade.sh b/src/opnsense/scripts/pkg_upgrade.sh index 7d3cd6e89..7c6ec3e83 100755 --- a/src/opnsense/scripts/pkg_upgrade.sh +++ b/src/opnsense/scripts/pkg_upgrade.sh @@ -7,7 +7,7 @@ if [ "$pkg_running" == "" ]; then rm /tmp/pkg_upgrade.progress fi # start pkg upgrade - pkg upgrade -y > /tmp/pkg_upgrade.progress & + pkg upgrade -y > /tmp/pkg_upgrade.progress echo '***DONE***' >> /tmp/pkg_upgrade.progress else echo 'Upgrade already in progress' diff --git a/src/www/system_firmware_check.php b/src/www/system_firmware_check.php index 851150758..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' ) { From e28efdc5ce5a247ca07d51970749645273f09910 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Tue, 23 Dec 2014 14:20:38 +0100 Subject: [PATCH 4/4] make: let `install' output the plist for us --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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