summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2009-10-13 15:17:04 -0400
committerScott Ullrich <sullrich@pfsense.org>2009-10-13 15:17:04 -0400
commita66393ce8291c36437d84d3e075789a5423e6e68 (patch)
treec4e40061a25e263e0b2bba04d60600f7eb0879c6 /etc
parent729b8d7c51884de9937220deb2b943980be98cd8 (diff)
downloadpfsense-a66393ce8291c36437d84d3e075789a5423e6e68.zip
pfsense-a66393ce8291c36437d84d3e075789a5423e6e68.tar.gz
Remove upgrade IMG file after failure
Diffstat (limited to 'etc')
-rwxr-xr-xetc/rc.firmware6
1 files changed, 5 insertions, 1 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware
index 59c3182..5d46a7f 100755
--- a/etc/rc.firmware
+++ b/etc/rc.firmware
@@ -143,6 +143,7 @@ pfSenseNanoBSDupgrade)
if [ `echo $IMG | grep "full"` ]; then
echo "You cannot use a full file for upgrade. Please use a file labeled upgrade."
file_notice "NanoBSDUpgradeFailure" "You have attemped to use a full NanoBSD installation file as an upgrade. Please use a NanoBSD file labeled 'upgrade' instead."
+ rm -f $IMG
/etc/rc.conf_mount_ro
exit 1
fi
@@ -200,6 +201,7 @@ pfSenseNanoBSDupgrade)
SIZE=`expr $SIZE + 1`
if [ "$SIZE" -lt "$NEW_IMG_SIZE" ]; then
file_notice "UpgradeFailure" "Upgrade failed due to the upgrade image being larger than the partition that is configured on disk. Halting. Size on disk: $SIZE < Size of new image: $NEW_IMG_SIZE"
+ rm -f $IMG
rm -f /var/run/firmwarelock.dirty
rm -f /var/run/firmware.lock
/etc/rc.conf_mount_ro
@@ -260,8 +262,9 @@ pfSenseNanoBSDupgrade)
/sbin/fsck_ufs -y /dev/$COMPLETE_PATH >> /conf/upgrade_log.txt 2>&1
if [ $? != 0 ]; then
file_notice "UpgradeFailure" "{\$g['product_name']} upgrade has failed. Your system has been left in a usable state."
+ rm -f $IMG
rm -f /var/run/firmwarelock.dirty
- rm -f /var/run/firmware.lock
+ rm -f /var/run/firmware.lock
/etc/rc.conf_mount_ro
exit 1
fi
@@ -296,6 +299,7 @@ pfSenseNanoBSDupgrade)
if [ $? != 0 ]; then
echo "Something went wrong when trying to update the fstab entry. Aborting upgrade."
file_notice "UpgradeFailure" "Something went wrong when trying to update the fstab entry. Aborting upgrade."
+ rm -f $IMG
rm -f /var/run/firmwarelock.dirty
rm -f /var/run/firmware.lock
umount /tmp/$GLABEL_SLICE
OpenPOWER on IntegriCloud