Revision f5ff6e0a
Added by Colin Smith over 20 years ago
- Add auto_upgrade() for easy XMLRPC exposure.
etc/inc/pfsense-utils.inc | ||
---|---|---|
976 | 976 |
return is_dir($path) || (make_dirs(dirname($path), $mode) && safe_mkdir($path, $mode)); |
977 | 977 |
} |
978 | 978 |
|
979 |
/* |
|
980 |
* auto_upgrade(): Upgrade pfSense to the latest firmware version. |
|
981 |
*/ |
|
982 |
function auto_upgrade() { |
|
983 |
global $config; |
|
984 |
$http_auth_username = ""; |
|
985 |
$http_auth_password = ""; |
|
986 |
if($config['system']['proxy_auth_username']) $http_auth_username = $config['system']['proxy_auth_username']; |
|
987 |
if($config['system']['proxy_auth_password']) $http_auth_password = $config['system']['proxy_auth_password']; |
|
988 |
if (isset($config['system']['alt_firmware_url']['enabled'])) { |
|
989 |
$firmwareurl=$config['system']['alt_firmware_url']['firmware_base_url']; |
|
990 |
$firmwarename=$config['system']['alt_firmware_url']['firmware_filename']; |
|
991 |
} else { |
|
992 |
$firmwareurl=$g['firmwarebaseurl']; |
|
993 |
$firmwarename=$g['firmwarefilename']; |
|
994 |
} |
|
995 |
exec_rc_script_async("/etc/rc.firmware_auto {$firmwareurl} {$firmwarename} {$http_auth_username} {$http_auth_password}"); |
|
996 |
} |
|
997 |
|
|
979 | 998 |
?> |
Also available in: Unified diff