Commit f54cf1cc authored by Franco Fichtner's avatar Franco Fichtner

services: design service commands as arrays by default

(cherry picked from commit 4d3ac63a)
parent 34bcc05b
......@@ -2613,7 +2613,7 @@ function services_get()
$pconfig = array();
$pconfig['name'] = "apinger";
$pconfig['description'] = gettext("Gateway Monitoring Daemon");
$pconfig['php']['start'] = 'setup_gateways_monitor';
$pconfig['php']['start'] = array('setup_gateways_monitor');
$services[] = $pconfig;
}
......@@ -2650,7 +2650,7 @@ function services_get()
$pconfig = array();
$pconfig['name'] = 'sshd';
$pconfig['description'] = gettext('Secure Shell Daemon');
$pconfig['configd']['start'] = 'sshd restart';
$pconfig['configd']['start'] = array('sshd restart');
$services[] = $pconfig;
}
......
......@@ -91,11 +91,15 @@ function service_control_start($name, $extras)
}
if (isset($service['configd']['start'])) {
configd_run($service['configd']['start']);
foreach ($service['configd']['start'] as $cmd) {
configd_run($cmd);
}
/* XXX fall through later */
return sprintf(gettext('%s has been started via configd.'), htmlspecialchars($name));
} elseif (isset($service['php']['start'])) {
$service['php']['start']();
foreach ($service['php']['start'] as $cmd) {
$cmd();
}
/* XXX fall through later */
return sprintf(gettext('%s has been started via php.'), htmlspecialchars($name));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment