summaryrefslogtreecommitdiffstats
path: root/etc/rc.firmware
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-06-28 17:09:39 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-06-28 17:09:39 -0400
commit9581e85b9341db512d37e2db8a797f8c2541c690 (patch)
tree6a02d9a0f834fabea2bcf6d66804012ae059db89 /etc/rc.firmware
parent024445ee7f95449ebf2738abd90396ca348df4f7 (diff)
downloadpfsense-9581e85b9341db512d37e2db8a797f8c2541c690.zip
pfsense-9581e85b9341db512d37e2db8a797f8c2541c690.tar.gz
Just for kicks I tried to use a full upgrade file instead of a file labaled upgrade. Bad things hapeppened. Prevent this in the future and error out and file a notice when this is attempted and give a hint that a file namebed "upgrade" must be used.
Diffstat (limited to 'etc/rc.firmware')
-rwxr-xr-xetc/rc.firmware13
1 files changed, 13 insertions, 0 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware
index 432b6ab..d1a4821 100755
--- a/etc/rc.firmware
+++ b/etc/rc.firmware
@@ -118,6 +118,19 @@ pfSenseNanoBSDupgrade)
exit 1
fi
+ # Prevent full upgrade file from being used to upgrade
+ if [ `echo $IMG | grep "full"` ]; then
+ echo "You cannot use a full file for upgrade. Please use a file labeled upgrade."
+ /usr/local/bin/php -q -d auto_prepend_file=config.inc <<ENDOFF
+ <?php
+ require_once("globals.inc");
+ require_once("functions.inc");
+ file_notice("NanoBSDUpgradeFailure", "You have attemped to use a full NanoBSD installation file as an upgrade. Please use a NanoBSD file labeled 'upgrade' instead.", "NanoBSDUpgradeFailure", "");
+ ?>
+ENDOFF
+ exit 1
+ fi
+
touch /var/run/firmware.lock
echo "Firmware upgrade in progress..." >> /cf/upgrade_log.txt 2>&1
OpenPOWER on IntegriCloud