summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-06-28 17:15:38 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-06-28 17:15:38 -0400
commit6252017131a6cb3d3b8c447487178572d00397b5 (patch)
tree8c77c8a6ba249e0d7037940156dac95f625c5bb4
parent9581e85b9341db512d37e2db8a797f8c2541c690 (diff)
downloadpfsense-6252017131a6cb3d3b8c447487178572d00397b5.zip
pfsense-6252017131a6cb3d3b8c447487178572d00397b5.tar.gz
Add a function named file_notice which invokes the php version.
-rwxr-xr-xetc/rc.firmware26
1 files changed, 12 insertions, 14 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware
index d1a4821..8340f8a 100755
--- a/etc/rc.firmware
+++ b/etc/rc.firmware
@@ -18,6 +18,16 @@ if [ $ACTION != "upgrade" ]; then
/sbin/umount -f /ftmp > /dev/null 2>&1
fi
+file_notice() {
+ /usr/local/bin/php -q -d auto_prepend_file=config.inc <<ENDOFF
+ <?php
+ require_once("globals.inc");
+ require_once("functions.inc");
+ file_notice("$1", "$2", "$1", "");
+ ?>
+ENDOFF
+}
+
output_env_to_log() {
date >> /cf/upgrade_log.txt
echo "" >> /cf/upgrade_log.txt
@@ -121,13 +131,7 @@ pfSenseNanoBSDupgrade)
# 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
+ file_notice "NanoBSDUpgradeFailure" "You have attemped to use a full NanoBSD installation file as an upgrade. Please use a NanoBSD file labeled 'upgrade' instead."
exit 1
fi
@@ -209,13 +213,7 @@ ENDOFF
echo "/sbin/fsck_ffs -y /dev/$COMPLETE_PATH" >> /cf/upgrade_log.txt
/sbin/fsck_ffs -y /dev/$COMPLETE_PATH >> /cf/upgrade_log.txt 2>&1
if [ $? != 0 ]; then
- /usr/local/bin/php -q -d auto_prepend_file=config.inc <<ENDOFF
- <?php
- require_once("globals.inc");
- require_once("functions.inc");
- file_notice("UpgradeFailure", "{\$g['product_name']} upgrade has failed. Your system has been left in a usable state.", "UpgradeFailure", "");
- ?>
-ENDOFF
+ file_notice "UpgradeFailure" "{\$g['product_name']} upgrade has failed. Your system has been left in a usable state."
rm /var/run/firmware.lock
exit 1
fi
OpenPOWER on IntegriCloud