summaryrefslogtreecommitdiffstats
path: root/etc/rc.firmware
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2004-11-25 01:18:18 +0000
committerScott Ullrich <sullrich@pfsense.org>2004-11-25 01:18:18 +0000
commit4668f9f755d5733c2ffaf761a24732b07ab70f89 (patch)
treeb7a91f50ee8c69d5fb4d6f61586b83620dd8f4a4 /etc/rc.firmware
parent405ad3174f75384912bcc27227acbda2e852b1cb (diff)
downloadpfsense-4668f9f755d5733c2ffaf761a24732b07ab70f89.zip
pfsense-4668f9f755d5733c2ffaf761a24732b07ab70f89.tar.gz
Introduce an easy way to upgrade firmware for pfSense.
Diffstat (limited to 'etc/rc.firmware')
-rwxr-xr-xetc/rc.firmware33
1 files changed, 32 insertions, 1 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware
index 56fc7a4..e2d8859 100755
--- a/etc/rc.firmware
+++ b/etc/rc.firmware
@@ -49,7 +49,38 @@ upgrade)
/sbin/umount -f /cf
/sbin/mount -r /cf
- echo "Done - rebooting system..."
+ echo "Done - rebooting system..."
+ /sbin/reboot
+ ;;
+pfSenseupgrade)
+ # wait 5 seconds before beginning
+ sleep 5
+
+ exec </dev/console >/dev/console 2>/dev/console
+
+ echo
+ echo "Firmware upgrade in progress..."
+
+ # backup config
+ mkdir /tmp/configbak
+ cp -p /conf/* /tmp/configbak
+ # mount /cf
+ /sbin/mount -w -o noatime /cf
+
+ # tar explode image onto hd
+ if [ -r $2 ]; then
+ tar xzvPf $2 -C / > /dev/null 2>&1
+ echo "Image installed."
+ fi
+
+ # restore config
+ cp -p /tmp/configbak/* /conf
+
+ # remount /cf ro
+ /sbin/umount -f /cf
+ /sbin/mount -r /cf
+
+ echo "Done - rebooting system..."
/sbin/reboot
;;
esac
OpenPOWER on IntegriCloud