diff options
Diffstat (limited to 'etc/rc.firmware_auto')
-rwxr-xr-x | etc/rc.firmware_auto | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/etc/rc.firmware_auto b/etc/rc.firmware_auto new file mode 100755 index 0000000..ac1ac95 --- /dev/null +++ b/etc/rc.firmware_auto @@ -0,0 +1,22 @@ +#!/bin/sh + +echo "Downloading latest.tgz ..." +cd /tmp && fetch http://www.pfSense.com/latest.tgz +echo "Downloading latest.tgz.md5 ..." +cd /tmp && fetch http://www.pfSense.com/latest.tgz.md5 + +PMD=`cat /tmp/latest.tgz.md5 | cut -d" " -f4 `; +MD=`/sbin/md5 /tmp/latest.tgz | cut -d" " -f4`; + +echo " Package MD5: ${PMD}" +echo "Downloaded MD5: ${MD}" + +if test "$PMD" = "$MD" + echo "MD5's match." + /etc/rc.firmware pfSenseupgrade /tmp/latest.tgz +then + echo "MD5's do not match." + exit 0 +fi + + |