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
9edc3167
Commit
9edc3167
authored
Jul 09, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) cleanup services.inc
parent
a0ecd6a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
18 deletions
+23
-18
services.inc
src/etc/inc/services.inc
+10
-18
diag_backup.php
src/www/diag_backup.php
+13
-0
No files found.
src/etc/inc/services.inc
View file @
9edc3167
...
...
@@ -80,7 +80,7 @@ function services_radvd_configure($blacklist = array())
{
global
$config
,
$g
;
if
(
!
is_array
(
$config
[
'dhcpdv6'
]))
{
if
(
!
is
set
(
$config
[
'dhcpdv6'
])
||
!
is
_array
(
$config
[
'dhcpdv6'
]))
{
$config
[
'dhcpdv6'
]
=
array
();
}
...
...
@@ -263,9 +263,11 @@ function services_radvd_configure($blacklist = array())
}
$radvdifs
[
$realif
]
=
$realif
;
$autotype
=
$config
[
'interfaces'
][
$trackif
][
'ipaddrv6'
];
if
(
isset
(
$config
[
'interfaces'
][
$trackif
][
'ipaddrv6'
]))
{
$autotype
=
$config
[
'interfaces'
][
$trackif
][
'ipaddrv6'
];
$radvdconf
.=
"# Generated config for
{
$autotype
}
delegation from
{
$trackif
}
on
{
$if
}
\n
"
;
}
$radvdconf
.=
"# Generated config for
{
$autotype
}
delegation from
{
$trackif
}
on
{
$if
}
\n
"
;
$radvdconf
.=
"interface
{
$realif
}
{\n"
;
$radvdconf
.=
"
\t
AdvSendAdvert on;
\n
"
;
$radvdconf
.=
"
\t
MinRtrAdvInterval 3;
\n
"
;
...
...
@@ -1005,7 +1007,7 @@ function services_dhcpdv6_configure($blacklist = array())
}
$syscfg
=
$config
[
'system'
];
if
(
!
is_array
(
$config
[
'dhcpdv6'
]))
if
(
!
is
set
(
$config
[
'dhcpdv6'
])
||
!
is
_array
(
$config
[
'dhcpdv6'
]))
$config
[
'dhcpdv6'
]
=
array
();
$dhcpdv6cfg
=
$config
[
'dhcpdv6'
];
$Iflist
=
get_configured_interface_list
();
...
...
@@ -1750,8 +1752,9 @@ function services_dnsmasq_configure()
}
/* Setup listen port, if non-default */
if
(
is
_port
(
$config
[
'dnsmasq'
][
'port'
]))
if
(
is
set
(
$config
[
'dnsmasq'
][
'port'
])
&&
is_port
(
$config
[
'dnsmasq'
][
'port'
]))
{
$args
.=
" --port=
{
$config
[
'dnsmasq'
][
'port'
]
}
"
;
}
$listen_addresses
=
""
;
if
(
isset
(
$config
[
'dnsmasq'
][
'interface'
]))
{
...
...
@@ -1841,13 +1844,14 @@ function services_dnsmasq_configure()
$args
.=
" --domain-needed "
;
}
if
(
$config
[
'dnsmasq'
][
'custom_options'
])
if
(
isset
(
$config
[
'dnsmasq'
][
'custom_options'
]))
{
foreach
(
preg_split
(
'/\s+/'
,
$config
[
'dnsmasq'
][
'custom_options'
])
as
$c
)
{
$args
.=
" "
.
escapeshellarg
(
"--
{
$c
}
"
);
$p
=
explode
(
'='
,
$c
);
if
(
array_key_exists
(
$p
[
0
],
$standard_args
))
unset
(
$standard_args
[
$p
[
0
]]);
}
}
$args
.=
' '
.
implode
(
' '
,
array_values
(
$standard_args
));
/* run dnsmasq */
...
...
@@ -2316,18 +2320,6 @@ function upnp_start()
}
}
/**
* check if cron exists
*/
function
cron_job_exists
(
$command
)
{
global
$config
;
foreach
(
$config
[
'cron'
][
'item'
]
as
$item
)
{
if
(
strstr
(
$item
[
'command'
],
$command
))
{
return
true
;
}
}
return
false
;
}
function
install_cron_job
(
$command
,
$active
=
false
,
$minute
=
"0"
,
$hour
=
"*"
,
$monthday
=
"*"
,
$month
=
"*"
,
$weekday
=
"*"
,
$who
=
"root"
)
{
global
$config
,
$g
;
...
...
src/www/diag_backup.php
View file @
9edc3167
...
...
@@ -43,6 +43,19 @@ require_once("filter.inc");
require_once
(
"services.inc"
);
require_once
(
"util.inc"
);
/**
* check if cron exists
*/
function
cron_job_exists
(
$command
)
{
global
$config
;
foreach
(
$config
[
'cron'
][
'item'
]
as
$item
)
{
if
(
strstr
(
$item
[
'command'
],
$command
))
{
return
true
;
}
}
return
false
;
}
$rrddbpath
=
'/var/db/rrd'
;
$rrdtool
=
'/usr/local/bin/rrdtool'
;
...
...
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