diff options
author | Renato Botelho <renato@netgate.com> | 2015-08-17 17:05:13 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-08-17 17:05:29 -0300 |
commit | c1367bd11624c866a2d166136c80dc0eda32e1ed (patch) | |
tree | 4ba50aac5e96d19322617120f5b232c39bda7b05 | |
parent | 8f400b8fdd6d4038928194799ef3f0852c86e6d4 (diff) | |
download | pfsense-c1367bd11624c866a2d166136c80dc0eda32e1ed.zip pfsense-c1367bd11624c866a2d166136c80dc0eda32e1ed.tar.gz |
Fix path for pre and post upgrade scripts
-rwxr-xr-x | etc/rc.firmware | 24 | ||||
-rwxr-xr-x | usr/local/share/pfSense/post_upgrade_command | 8 |
2 files changed, 16 insertions, 16 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware index 5d140fe..a366cc5 100755 --- a/etc/rc.firmware +++ b/etc/rc.firmware @@ -253,12 +253,12 @@ pfSenseNanoBSDupgrade) cp /boot/loader.conf.local /tmp/$GLABEL_SLICE/boot/loader.conf.local fi - # If /tmp/$GLABEL_SLICE/tmp/post_upgrade_command exists + # If /tmp/$GLABEL_SLICE/usr/local/share/pfSense/post_upgrade_command exists # after update then execute the command. echo "Checking for post_upgrade_command..." >> /conf/upgrade_log.txt - if [ -f /tmp/$GLABEL_SLICE/tmp/post_upgrade_command ]; then + if [ -f /tmp/$GLABEL_SLICE/usr/local/share/pfSense/post_upgrade_command ]; then echo "Found post_upgrade_command, executing ($GLABEL_SLICE)..." >> /conf/upgrade_log.txt - sh /tmp/$GLABEL_SLICE/tmp/post_upgrade_command $GLABEL_SLICE >> /conf/upgrade_log.txt 2>&1 + sh /tmp/$GLABEL_SLICE/usr/local/share/pfSense/post_upgrade_command $GLABEL_SLICE >> /conf/upgrade_log.txt 2>&1 fi # Update fstab @@ -371,10 +371,10 @@ pfSenseupgrade) remove_chflags # Do we have a pre-upgrade hook in the update file? - if [ `tar tvzf $IMG | grep /tmp/pre_upgrade_command | wc -l` -gt 0 ]; then - tar xzvf $IMG -C / ./tmp/pre_upgrade_command >> /conf/upgrade_log.txt 2>&1 - chmod a+rx /tmp/pre_upgrade_command >> /conf/upgrade_log.txt 2>&1 - sh /tmp/pre_upgrade_command >> /conf/upgrade_log.txt 2>&1 + if [ `tar tvzf $IMG | grep /usr/local/share/pfSense/pre_upgrade_command | wc -l` -gt 0 ]; then + tar xzvf $IMG -C / ./usr/local/share/pfSense/pre_upgrade_command >> /conf/upgrade_log.txt 2>&1 + chmod a+rx /usr/local/share/pfSense/pre_upgrade_command >> /conf/upgrade_log.txt 2>&1 + sh /usr/local/share/pfSense/pre_upgrade_command >> /conf/upgrade_log.txt 2>&1 fi echo "Firmware upgrade in progress..." >> /conf/upgrade_log.txt 2>&1 @@ -431,13 +431,13 @@ pfSenseupgrade) # Remove saved commit ID for gitsync rm -f /etc/version.gitsync - # If /tmp/post_upgrade_command exists after update + # If /usr/local/share/pfSense/post_upgrade_command exists after update # then execute the command. - if [ -f /tmp/post_upgrade_command ]; then - if [ ! -x /tmp/post_upgrade_command ]; then - chmod ug+x /tmp/post_upgrade_command + if [ -f /usr/local/share/pfSense/post_upgrade_command ]; then + if [ ! -x /usr/local/share/pfSense/post_upgrade_command ]; then + chmod ug+x /usr/local/share/pfSense/post_upgrade_command fi - /tmp/post_upgrade_command >> /conf/upgrade_log.txt 2>&1 + /usr/local/share/pfSense/post_upgrade_command >> /conf/upgrade_log.txt 2>&1 fi # remove unused files diff --git a/usr/local/share/pfSense/post_upgrade_command b/usr/local/share/pfSense/post_upgrade_command index eea691f..a9e3e57 100755 --- a/usr/local/share/pfSense/post_upgrade_command +++ b/usr/local/share/pfSense/post_upgrade_command @@ -20,10 +20,10 @@ else fi # Now turn on or off serial console as needed -echo "Checking for ${ROOT}tmp/post_upgrade_command.php... " >> /conf/upgrade_log.txt -if [ -x ${ROOT}tmp/post_upgrade_command.php ]; then - echo "Running ${ROOT}tmp/post_upgrade_command.php $1" >> /conf/upgrade_log.txt - ${ROOT}tmp/post_upgrade_command.php $1 >> /conf/upgrade_log.txt 2>&1 +echo "Checking for ${ROOT}usr/local/share/pfSense/post_upgrade_command.php... " >> /conf/upgrade_log.txt +if [ -x ${ROOT}usr/local/share/pfSense/post_upgrade_command.php ]; then + echo "Running ${ROOT}usr/local/share/pfSense/post_upgrade_command.php $1" >> /conf/upgrade_log.txt + ${ROOT}usr/local/share/pfSense/post_upgrade_command.php $1 >> /conf/upgrade_log.txt 2>&1 fi # Remove any previous MD5 sum files |