Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
f763c7cd
Commit
f763c7cd
authored
Sep 16, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
config: reformat config.xml sample, some additions
parent
06723bcf
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
613 additions
and
674 deletions
+613
-674
config.xml.sample
src/etc/config.xml.sample
+580
-647
config.lib.inc
src/etc/inc/config.lib.inc
+32
-22
rc.bootup
src/etc/rc.bootup
+1
-5
No files found.
src/etc/config.xml.sample
View file @
f763c7cd
This diff is collapsed.
Click to expand it.
src/etc/inc/config.lib.inc
View file @
f763c7cd
...
...
@@ -37,7 +37,6 @@ require_once("legacy_bindings.inc");
require_once
(
'upgrade_config.inc'
);
require_once
(
"certs.inc"
);
/* make a global alias table (for faster lookups) */
function
alias_make_table
(
$config
)
{
...
...
@@ -98,11 +97,19 @@ function parse_config()
* null
******/
/* convert configuration, if necessary */
function
convert_config
()
{
function
convert_config
()
{
global
$config
,
$g
;
$now
=
date
(
"H:i:s"
);
log_error
(
sprintf
(
gettext
(
"Start Configuration upgrade at %s, set execution timeout to 15 minutes"
),
$now
));
//ini_set("max_execution_time", "900");
if
(
!
isset
(
$config
[
'revision'
]))
{
/* force a revision tag for proper handling in config history */
write_config
(
'Factory configuration'
,
false
);
}
if
(
$config
[
'version'
]
==
$g
[
'latest_config'
])
{
/* already at latest version */
return
;
}
/* special case upgrades */
/* fix every minute crontab bogons entry */
...
...
@@ -118,8 +125,6 @@ function convert_config() {
}
}
}
if
(
$config
[
'version'
]
==
$g
[
'latest_config'
])
return
;
/* already at latest version */
// Save off config version
$prev_version
=
$config
[
'version'
];
...
...
@@ -134,11 +139,9 @@ function convert_config() {
$config
[
'version'
]
=
sprintf
(
'%.1f'
,
$next
/
10
);
}
$now
=
date
(
"H:i:s"
);
log_error
(
sprintf
(
gettext
(
"Ended Configuration upgrade at %s"
),
$now
));
if
(
$prev_version
!=
$config
[
'version'
])
if
(
$prev_version
!=
$config
[
'version'
])
{
write_config
(
sprintf
(
gettext
(
'Upgraded config version level from %1$s to %2$s'
),
$prev_version
,
$config
[
'version'
]));
}
}
...
...
@@ -318,7 +321,10 @@ function set_device_perms() {
}
function
make_config_revision_entry
(
$desc
=
null
,
$override_user
=
null
)
{
function
make_config_revision_entry
(
$desc
=
null
,
$override_user
=
null
)
{
global
$config
;
if
(
empty
(
$override_user
))
{
if
(
empty
(
$_SESSION
[
"Username"
]))
{
$username
=
getenv
(
"USER"
);
...
...
@@ -330,22 +336,26 @@ function make_config_revision_entry($desc = null, $override_user = null) {
if
(
!
empty
(
$_SERVER
[
'REMOTE_ADDR'
]))
{
$username
.=
'@'
.
$_SERVER
[
'REMOTE_ADDR'
];
}
}
else
{
}
else
{
$username
=
$override_user
;
}
$revision
=
array
();
if
(
time
()
>
mktime
(
0
,
0
,
0
,
9
,
1
,
2004
))
/* make sure the clock settings are plausible */
$revision
[
'time'
]
=
time
();
/* Log the running script so it's not entirely unlogged what changed */
if
(
$desc
==
"Unknown"
)
$desc
=
sprintf
(
gettext
(
"%s made unknown change"
),
$_SERVER
[
'SCRIPT_NAME'
]);
if
(
!
empty
(
$desc
))
$revision
[
'description'
]
=
"
{
$username
}
: "
.
$desc
;
$revision
[
'username'
]
=
$username
;
$revision
[
'time'
]
=
time
();
if
(
$revision
[
'time'
]
==
$config
[
'revision'
][
'time'
])
{
/* avoid conflicting timestamps (a second is long) */
$revision
[
'time'
]
=
intval
(
$revision
[
'time'
])
+
1
;
}
if
(
$desc
==
null
||
$desc
==
'Unknown'
)
{
$revision
[
'description'
]
=
sprintf
(
gettext
(
"%s made unknown change"
),
$_SERVER
[
'SCRIPT_NAME'
]);
}
else
{
$revision
[
'description'
]
=
$desc
;
}
return
$revision
;
}
...
...
src/etc/rc.bootup
View file @
f763c7cd
...
...
@@ -162,6 +162,7 @@ if (is_install_media()) {
echo
"Loading configuration..."
;
global
$config
;
$config
=
parse_config
();
convert_config
();
echo
"done.
\n
"
;
/*
...
...
@@ -177,11 +178,6 @@ if (is_interface_mismatch()) {
led_kitt
();
}
/* convert config and clean backups */
echo
"Updating configuration..."
;
convert_config
();
echo
"done.
\n
"
;
/* read in /etc/sysctl.conf and set values if needed */
echo
"Setting up extended sysctls..."
;
system_setup_sysctl
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment