Revision d884b49c
Added by Colin Smith over 20 years ago
etc/inc/pfsense-utils.inc | ||
---|---|---|
30 | 30 |
POSSIBILITY OF SUCH DAMAGE. |
31 | 31 |
*/ |
32 | 32 |
|
33 |
/****h* pfSense/pfsense-utils |
|
34 |
* NAME |
|
35 |
* pfsense-utils.inc - Utilities specific to pfSense |
|
36 |
* DESCRIPTION |
|
37 |
* This include contains various pfSense specific functions. |
|
38 |
* HISTORY |
|
39 |
* $Id$ |
|
40 |
****** |
|
41 |
* |
|
42 |
* pfSense-utils.inc |
|
43 |
* Utilities specific to pfSense |
|
44 |
* part of pfSense (www.pfSense.com) |
|
45 |
* |
|
46 |
* Copyright (C) 2005 Scott Ullrich (sullrich@gmail.com) |
|
47 |
* All rights reserved. |
|
48 |
* Redistribution and use in source and binary forms, with or without |
|
49 |
* modification, are permitted provided that the following conditions are met: |
|
50 |
* |
|
51 |
* 1. Redistributions of source code must retain the above copyright notice, |
|
52 |
* this list of conditions and the following disclaimer. |
|
53 |
* |
|
54 |
* 2. Redistributions in binary form must reproduce the above copyright |
|
55 |
* notice, this list of conditions and the following disclaimer in the |
|
56 |
* documentation and/or other materials provided with the distribution. |
|
57 |
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, |
|
58 |
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY |
|
59 |
* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
|
60 |
* AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, |
|
61 |
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
|
62 |
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
|
63 |
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
|
64 |
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
|
65 |
* RISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
|
66 |
* POSSIBILITY OF SUCH DAMAGE. |
|
67 |
* |
|
68 |
*/ |
|
69 |
|
|
33 | 70 |
/* |
34 | 71 |
* log_error: send string to syslog |
35 | 72 |
*/ |
... | ... | |
996 | 1033 |
return is_dir($path) || (make_dirs(dirname($path), $mode) && safe_mkdir($path, $mode)); |
997 | 1034 |
} |
998 | 1035 |
|
999 |
/* |
|
1000 |
* auto_upgrade(): Upgrade pfSense to the latest firmware version. |
|
1001 |
*/ |
|
1036 |
/****f* pfsense-utils/auto_upgrade |
|
1037 |
* NAME |
|
1038 |
* auto_upgrade - pfSense autoupdate handler. |
|
1039 |
* FUNCTION |
|
1040 |
* Begin the pfSense autoupdate process. This function calls check_firmware_version to get |
|
1041 |
* a list of current versions and then loops through them, applying binary diffs etc. |
|
1042 |
* RESULT |
|
1043 |
* null |
|
1044 |
* BUGS |
|
1045 |
* This function needs to have logic in place to automatically switch over to full updates |
|
1046 |
* if a certain amount of binary diffs do not apply successfully. |
|
1047 |
* SEE ALSO |
|
1048 |
* pfsense.utils/check_firmware_version |
|
1049 |
******/ |
|
1050 |
|
|
1051 |
|
|
1002 | 1052 |
function auto_upgrade() { |
1003 | 1053 |
global $config, $g; |
1004 | 1054 |
if (isset($config['system']['alt_firmware_url']['enabled'])) { |
... | ... | |
1052 | 1102 |
return $toreturn; |
1053 | 1103 |
} |
1054 | 1104 |
|
1055 |
?> |
|
1105 |
?> |
Also available in: Unified diff
Initial commit of robodoc-formatted comments.