diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2009-10-13 15:18:00 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2009-10-13 15:18:07 -0400 |
commit | 9974dae5a2b899f4c56e351eecd3745187392784 (patch) | |
tree | 4eaa49ab32ae2ec5bced8024ea4183c5702b77d7 /etc/rc.firmware | |
parent | 89c3be09cb00914cd60b1288d78e4e1ab45a1e8d (diff) | |
download | pfsense-9974dae5a2b899f4c56e351eecd3745187392784.zip pfsense-9974dae5a2b899f4c56e351eecd3745187392784.tar.gz |
Remove upgrade IMG file after failure
Diffstat (limited to 'etc/rc.firmware')
-rwxr-xr-x | etc/rc.firmware | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware index 62a309b..86796db 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 @@ -201,6 +202,7 @@ pfSenseNanoBSDupgrade) 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" echo "Upgrade failed. Please check the system log file for more information" | wall + rm -f $IMG rm -f /var/run/firmwarelock.dirty rm -f /var/run/firmware.lock rm -f ${IMG} @@ -262,6 +264,7 @@ 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 /etc/rc.conf_mount_ro @@ -298,6 +301,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 |