fix for iptables restart on Debian/Ubuntu

This commit is contained in:
Serghey Rodin 2015-07-01 02:22:43 +03:00
commit 8be83a9e73
5 changed files with 23 additions and 11 deletions

View file

@ -117,9 +117,9 @@ fi
service=$DNS_SYSTEM service=$DNS_SYSTEM
if [ ! -z "$service" ] && [ "$service" != 'remote' ]; then if [ ! -z "$service" ] && [ "$service" != 'remote' ]; then
if [ "$service" == 'bind' ] || [ "$service" == 'bind9' ]; then if [ "$service" == 'bind' ] || [ "$service" == 'bind9' ]; then
service='named' proc_name='named'
fi fi
get_srv_state $service get_srv_state $service $proc_name
str="$str\nNAME='$service' SYSTEM='dns server' STATE='$state' CPU='$cpu'" str="$str\nNAME='$service' SYSTEM='dns server' STATE='$state' CPU='$cpu'"
str="$str MEM='$mem' RTIME='$rtime'" str="$str MEM='$mem' RTIME='$rtime'"
fi fi

View file

@ -23,14 +23,14 @@ if ($_SESSION['user'] == 'admin') {
break; break;
case 'restart': $cmd='v-restart-service'; case 'restart': $cmd='v-restart-service';
break; break;
default: header("Location: /list/services/"); exit; default: header("Location: /list/server/"); exit;
} }
if ((!empty($_POST['system'])) && ($action == 'restart')) { if ((!empty($_POST['system'])) && ($action == 'restart')) {
exec (VESTA_CMD."v-restart-system yes", $output, $return_var); exec (VESTA_CMD."v-restart-system yes", $output, $return_var);
$_SESSION['error_srv'] = 'The system is going down for reboot NOW!'; $_SESSION['error_srv'] = 'The system is going down for reboot NOW!';
unset($output); unset($output);
header("Location: /list/services/"); header("Location: /list/server/");
exit; exit;
} }
@ -40,4 +40,4 @@ if ($_SESSION['user'] == 'admin') {
} }
} }
header("Location: /list/services/"); header("Location: /list/server/");

View file

@ -7,8 +7,12 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
if ($_SESSION['user'] == 'admin') { if ($_SESSION['user'] == 'admin') {
if (!empty($_GET['srv'])) { if (!empty($_GET['srv'])) {
$v_service = escapeshellarg($_GET['srv']); if ($_GET['srv'] == 'iptables') {
exec (VESTA_CMD."v-restart-service ".$v_service, $output, $return_var); exec (VESTA_CMD."v-update-firewall", $output, $return_var);
} else {
$v_service = escapeshellarg($_GET['srv']);
exec (VESTA_CMD."v-restart-service ".$v_service, $output, $return_var);
}
} }
if ($return_var != 0) { if ($return_var != 0) {
$error = implode('<br>', $output); $error = implode('<br>', $output);

View file

@ -7,8 +7,12 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
if ($_SESSION['user'] == 'admin') { if ($_SESSION['user'] == 'admin') {
if (!empty($_GET['srv'])) { if (!empty($_GET['srv'])) {
$v_service = escapeshellarg($_GET['srv']); if ($_GET['srv'] == 'iptables') {
exec (VESTA_CMD."v-start-service ".$v_service, $output, $return_var); exec (VESTA_CMD."v-update-firewall", $output, $return_var);
} else {
$v_service = escapeshellarg($_GET['srv']);
exec (VESTA_CMD."v-start-service ".$v_service, $output, $return_var);
}
} }
if ($return_var != 0) { if ($return_var != 0) {
$error = implode('<br>', $output); $error = implode('<br>', $output);

View file

@ -7,8 +7,12 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
if ($_SESSION['user'] == 'admin') { if ($_SESSION['user'] == 'admin') {
if (!empty($_GET['srv'])) { if (!empty($_GET['srv'])) {
$v_service = escapeshellarg($_GET['srv']); if ($_GET['srv'] == 'iptables') {
exec (VESTA_CMD."v-stop-service ".$v_service, $output, $return_var); exec (VESTA_CMD."v-stop-firewall", $output, $return_var);
} else {
$v_service = escapeshellarg($_GET['srv']);
exec (VESTA_CMD."v-stop-service ".$v_service, $output, $return_var);
}
} }
if ($return_var != 0) { if ($return_var != 0) {
$error = implode('<br>', $output); $error = implode('<br>', $output);