Subversion Repositories ALCASAR

Rev

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

Rev 595 Rev 604
Line 107... Line 107...
107
		exec("sudo /sbin/service $service $action",$retval, $retstatus);
107
		exec("sudo /sbin/service $service $action",$retval, $retstatus);
108
		if ($service == "sshd"){
108
		if ($service == "sshd"){
109
			if ($action == "start"){ 
109
			if ($action == "start"){ 
110
				exec("sudo /sbin/chkconfig --add $service");
110
				exec("sudo /sbin/chkconfig --add $service");
111
				file_put_contents(ALCASAR_NETWORK, str_replace('SSH=off', 'SSH=on', file_get_contents(ALCASAR_NETWORK)));
111
				file_put_contents(ALCASAR_NETWORK, str_replace('SSH=off', 'SSH=on', file_get_contents(ALCASAR_NETWORK)));
-
 
112
				exec ("sudo /usr/local/bin/alcasar-iptables.sh");
112
				}
113
				}
113
			if ($action == "stop"){
114
			if ($action == "stop"){
114
			       	exec("sudo /sbin/chkconfig --del $service");
115
			       	exec("sudo /sbin/chkconfig --del $service");
115
				file_put_contents(ALCASAR_NETWORK, str_replace('SSH=on', 'SSH=off', file_get_contents(ALCASAR_NETWORK)));
116
				file_put_contents(ALCASAR_NETWORK, str_replace('SSH=on', 'SSH=off', file_get_contents(ALCASAR_NETWORK)));
-
 
117
				exec ("sudo /usr/local/bin/alcasar-iptables.sh");
116
				}
118
				}
117
			}
119
			}
118
		return $retstatus;
120
		return $retstatus;
119
	} else {
121
	} else {
120
		return false;
122
		return false;