Commit 0400ecba authored by anarcat's avatar anarcat Committed by anarcat

detect properly the proper apachectl command to run on debian + apache2,...

detect properly the proper apachectl command to run on debian + apache2, FreeBSD and probably others
parent 57a999de
......@@ -82,7 +82,18 @@ function provision_init() {
define('PROVISION_DB_USER', variable_get('provision_db_user', 'root'));
define('PROVISION_DB_PASSWD', variable_get('provision_db_passwd', 'root'));
define('PROVISION_DB_HOST', variable_get('provision_db_host', 'localhost'));
define('PROVISION_RESTART_CMD', variable_get('provision_restart_cmd', 'sudo /usr/sbin/apachectl graceful'));
# try to detect the apache restart command
$command = '/usr/sbin/apachectl'; # a proper default for most of the world
foreach (array('/usr/local/sbin/apachectl', # freebsd
'/usr/sbin/apache2ctl', # debian + apache2
$command) as $test) {
if (is_executable($test)) {
$command = $test;
}
}
define('PROVISION_RESTART_CMD', variable_get('provision_restart_cmd', "sudo $command graceful"));
global $base_url;
define('PROVISION_BASE_URL', $base_url);
......
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