79,7 → 79,7 |
define ("ALCASAR_CHILLI", "/etc/chilli.conf"); |
define ("ALCASAR_ETH0", "/etc/sysconfig/network-scripts/default-ifcfg-eth0"); |
define ("ALCASAR_ETH1", "/etc/sysconfig/network-scripts/ifcfg-eth1"); |
|
define ("ALCASAR_NETWORK", "/usr/local/etc/alcasar-network"); |
/******************************************************************** |
* TEST DES FICHIERS DE CONFIGURATION * |
*********************************************************************/ |
106,8 → 106,14 |
if (($action == "start")||($action == "stop")||($action == "restart")){ |
exec("sudo /sbin/service $service $action",$retval, $retstatus); |
if ($service == "sshd"){ |
if ($action == "start"){ exec("sudo /sbin/chkconfig --add $service");} |
if ($action == "stop"){ exec("sudo /sbin/chkconfig --del $service");} |
if ($action == "start"){ |
exec("sudo /sbin/chkconfig --add $service"); |
file_put_contents(ALCASAR_NETWORK, str_replace('SSH=off', 'SSH=on', file_get_contents(ALCASAR_NETWORK))); |
} |
if ($action == "stop"){ |
exec("sudo /sbin/chkconfig --del $service"); |
file_put_contents(ALCASAR_NETWORK, str_replace('SSH=on', 'SSH=off', file_get_contents(ALCASAR_NETWORK))); |
} |
} |
return $retstatus; |
} else { |