summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xetc/rc.firmware5
-rwxr-xr-xetc/rc.firmware_auto22
-rwxr-xr-xusr/local/www/system_firmware.php20
3 files changed, 46 insertions, 1 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware
index b7d993a..141231e 100755
--- a/etc/rc.firmware
+++ b/etc/rc.firmware
@@ -6,7 +6,7 @@
# Copyright (C) 2003 Manuel Kasper <mk@neon1.net>.
# All rights reserved.
-CFDEVICE=`cat /var/etc/cfdevice`
+#CFDEVICE=`cat /var/etc/cfdevice`
if [ $1 != "upgrade" ]; then
/sbin/umount -f /ftmp > /dev/null 2>&1
@@ -17,6 +17,9 @@ enable)
/sbin/mount_mfs -s 15360 -T qp120at -b 8192 -f 1024 dummy /ftmp \
> /dev/null 2>&1
;;
+auto)
+ /etc/rc.firmware_auto
+ ;;
upgrade)
# wait 5 seconds before beginning
sleep 5
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
+
+
diff --git a/usr/local/www/system_firmware.php b/usr/local/www/system_firmware.php
index 7f593a5..f219979 100755
--- a/usr/local/www/system_firmware.php
+++ b/usr/local/www/system_firmware.php
@@ -31,6 +31,11 @@
$d_isfwfile = 1; require("guiconfig.inc");
+if($_GET['autoupgrade'] <> "") {
+ exec_rc_script_async("/etc/rc.firmware_auto");
+ $savemsg = "pfSense is now auto upgrading. The firewall will automatically reboot if it succeeds.";
+}
+
/* checks with m0n0.ch to see if a newer firmware version is available;
returns any HTML message it gets from the server */
function check_firmware_version() {
@@ -200,6 +205,21 @@ print_info_box($sig_warning);
has started. The firewall will reboot automatically after
storing the new firmware. The configuration will be maintained.</span></td>
</tr>
+
+ <tr>
+ <td colspan="2">&nbsp;</td>
+ </tr>
+ <tr>
+ <td colspan="2" class="listtopic">Invoke pfSense Auto Upgrade</td>
+ </tr>
+ <tr>
+ <td width="22%" valign="baseline" class="vncell">&nbsp;</td>
+ <td width="78%" class="vtable">
+ <p> Click this button to reinstall all system packages. This may wake a while.<br>
+ <br>
+ <a href="system_firmware.php?autoupgrade=true">Invoke Auto Upgrade</a>
+ </tr>
+
</table>
</form>
<?php endif; endif; ?>
OpenPOWER on IntegriCloud