diff options
-rwxr-xr-x | etc/rc.firmware_auto | 7 | ||||
-rwxr-xr-x | usr/local/www/system_firmware.php | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/etc/rc.firmware_auto b/etc/rc.firmware_auto index 567ed57..7ef1830 100755 --- a/etc/rc.firmware_auto +++ b/etc/rc.firmware_auto @@ -5,6 +5,13 @@ sleep 5 logger -p daemon.info -i -t AutoUpgrade "Auto Upgrade started" +HTTP_AUTH="" + +# if username and password is passed, let fetch utilize. +if [ $# -gt 1 ]; then +HTTP_AUTH="basic:*:$1:$2" +fi + echo "Downloading latest.tgz ..." | logger -p daemon.info -i -t AutoUpgrade cd /tmp && fetch http://www.pfSense.com/latest.tgz | logger -p daemon.info -i -t AutoUpgrade echo "Downloading latest.tgz.md5 ..." | logger -p daemon.info -i -t AutoUpgrade diff --git a/usr/local/www/system_firmware.php b/usr/local/www/system_firmware.php index ea78b0f..dc5f652 100755 --- a/usr/local/www/system_firmware.php +++ b/usr/local/www/system_firmware.php @@ -32,7 +32,13 @@ $d_isfwfile = 1; require("guiconfig.inc"); if($_GET['autoupgrade'] <> "") { - exec_rc_script_async("/etc/rc.firmware_auto"); + $http_auth_username = ""; + $http_auth_password = ""; + if($config['system']['proxy_auth_username']) + $http_auth_username = $config['system']['proxy_auth_username']; + if($config['system']['proxy_auth_password']) + $http_auth_password = $config['system']['proxy_auth_password']; + exec_rc_script_async("/etc/rc.firmware_auto {$http_auth_username} {$http_auth_password}"); $savemsg = "pfSense is now auto upgrading. The firewall will automatically reboot if it succeeds."; } |