Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Open sidebar
Guilherme Filippo
ISPConfig 3
Commits
47f5e03b
Commit
47f5e03b
authored
Sep 25, 2010
by
jwarnier
Browse files
Use $conf['init_scripts'] instead of calling /etc/init.d/* directly
parent
ae81a2b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
server/mods-available/dns_module.inc.php
View file @
47f5e03b
...
...
@@ -117,17 +117,17 @@ class dns_module {
function
restartBind
(
$action
=
'restart'
)
{
global
$app
;
$
command
=
''
;
if
(
is_file
(
'/etc/init.d/
bind9'
))
{
$
command
=
'/etc/init.d/
bind9'
;
$
daemon
=
''
;
if
(
is_file
(
$conf
[
'init_scripts'
]
.
'/'
.
'
bind9'
))
{
$
daemon
=
'
bind9'
;
}
else
{
$
command
=
'/etc/init.d/
named'
;
$
daemon
=
'
named'
;
}
if
(
$action
==
'restart'
)
{
exec
(
$co
mmand
.
' restart'
);
exec
(
$co
nf
[
'init_scripts'
]
.
'/'
.
$daemon
.
' restart'
);
}
else
{
exec
(
$co
mmand
.
' reload'
);
exec
(
$co
nf
[
'init_scripts'
]
.
'/'
.
$daemon
.
' reload'
);
}
}
...
...
@@ -166,13 +166,14 @@ class dns_module {
*/
file_put_contents
(
'/etc/powerdns/pdns.d/pdns.ispconfig-axfr'
,
$options
.
"
\n
"
);
if
(
is_file
(
'/etc/init.d/powerdns'
))
{
$command
=
'/etc/init.d/powerdns'
;
daemon
=
''
;
if
(
is_file
(
$conf
[
'init_scripts'
]
.
'/'
.
'powerdns'
))
{
$daemon
=
'powerdns'
;
}
else
{
$
command
=
'/etc/init.d/
pdns'
;
$
daemon
=
'
pdns'
;
}
exec
(
$co
mmand
.
' restart'
);
exec
(
$co
nf
[
'init_scripts'
]
.
'/'
.
$daemon
.
' restart'
);
// unset $tmps;
...
...
server/mods-available/web_module.inc.php
View file @
47f5e03b
...
...
@@ -83,8 +83,8 @@ class web_module {
*/
$app
->
modules
->
registerTableHook
(
'web_domain'
,
'web_module'
,
'process'
);
$app
->
modules
->
registerTableHook
(
'ftp_user'
,
'web_module'
,
'process'
);
$app
->
modules
->
registerTableHook
(
'shell_user'
,
'web_module'
,
'process'
);
$app
->
modules
->
registerTableHook
(
'ftp_user'
,
'web_module'
,
'process'
);
$app
->
modules
->
registerTableHook
(
'shell_user'
,
'web_module'
,
'process'
);
$app
->
modules
->
registerTableHook
(
'webdav_user'
,
'web_module'
,
'process'
);
// Register service
...
...
@@ -129,21 +129,21 @@ class web_module {
function
restartHttpd
(
$action
=
'restart'
)
{
global
$app
;
$
command
=
''
;
if
(
is_file
(
'/etc/init.d/
httpd'
))
{
$
command
=
'/etc/init.d/
httpd'
;
$
daemon
=
''
;
if
(
is_file
(
$conf
[
'init_scripts'
]
.
'/'
.
'
httpd'
))
{
$
daemon
=
'
httpd'
;
}
else
{
$
command
=
'/etc/init.d/
apache2'
;
$
daemon
=
'
apache2'
;
}
if
(
$action
==
'restart'
)
{
exec
(
$co
mmand
.
' restart'
);
exec
(
$co
nf
[
'init_scripts'
]
.
'/'
.
$daemon
.
' restart'
);
}
else
{
exec
(
$co
mmand
.
' reload'
);
exec
(
$co
nf
[
'init_scripts'
]
.
'/'
.
$daemon
.
' reload'
);
}
}
}
// end class
?>
\ No newline at end of file
?>
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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