summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-08-17 17:05:13 -0300
committerRenato Botelho <renato@netgate.com>2015-08-17 17:05:29 -0300
commitc1367bd11624c866a2d166136c80dc0eda32e1ed (patch)
tree4ba50aac5e96d19322617120f5b232c39bda7b05
parent8f400b8fdd6d4038928194799ef3f0852c86e6d4 (diff)
downloadpfsense-c1367bd11624c866a2d166136c80dc0eda32e1ed.zip
pfsense-c1367bd11624c866a2d166136c80dc0eda32e1ed.tar.gz
Fix path for pre and post upgrade scripts
-rwxr-xr-xetc/rc.firmware24
-rwxr-xr-xusr/local/share/pfSense/post_upgrade_command8
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
OpenPOWER on IntegriCloud