Subversion Repositories ALCASAR

Rev

Rev 361 | Rev 595 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 361 Rev 434
Line 103... Line 103...
103
 
103
 
104
//fonction pour faire une action (start,stop,restart) sur un service
104
//fonction pour faire une action (start,stop,restart) sur un service
105
function serviceExec($service, $action){
105
function serviceExec($service, $action){
106
	if (($action == "start")||($action == "stop")||($action == "restart")){
106
	if (($action == "start")||($action == "stop")||($action == "restart")){
107
		exec("sudo /sbin/service $service $action",$retval, $retstatus);
107
		exec("sudo /sbin/service $service $action",$retval, $retstatus);
-
 
108
		if ($service == "sshd"){
-
 
109
			if ($action == "start"){ exec("sudo /sbin/chkconfig --add $service");}
-
 
110
			if ($action == "stop"){ exec("sudo /sbin/chkconfig --del $service");}
-
 
111
			}
108
		return $retstatus;
112
		return $retstatus;
109
	} else {
113
	} else {
110
		return false;
114
		return false;
111
	}
115
	}
112
}
116
}