Skip to content

Commit 8be83a9

Browse files
committed
fix for iptables restart on Debian/Ubuntu
1 parent def1198 commit 8be83a9

File tree

5 files changed

+23
-11
lines changed

5 files changed

+23
-11
lines changed

bin/v-list-sys-services

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ fi
117117
service=$DNS_SYSTEM
118118
if [ ! -z "$service" ] && [ "$service" != 'remote' ]; then
119119
if [ "$service" == 'bind' ] || [ "$service" == 'bind9' ]; then
120-
service='named'
120+
proc_name='named'
121121
fi
122-
get_srv_state $service
122+
get_srv_state $service $proc_name
123123
str="$str\nNAME='$service' SYSTEM='dns server' STATE='$state' CPU='$cpu'"
124124
str="$str MEM='$mem' RTIME='$rtime'"
125125
fi

web/bulk/service/index.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
break;
2424
case 'restart': $cmd='v-restart-service';
2525
break;
26-
default: header("Location: /list/services/"); exit;
26+
default: header("Location: /list/server/"); exit;
2727
}
2828

2929
if ((!empty($_POST['system'])) && ($action == 'restart')) {
3030
exec (VESTA_CMD."v-restart-system yes", $output, $return_var);
3131
$_SESSION['error_srv'] = 'The system is going down for reboot NOW!';
3232
unset($output);
33-
header("Location: /list/services/");
33+
header("Location: /list/server/");
3434
exit;
3535
}
3636

@@ -40,4 +40,4 @@
4040
}
4141
}
4242

43-
header("Location: /list/services/");
43+
header("Location: /list/server/");

web/restart/service/index.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77

88
if ($_SESSION['user'] == 'admin') {
99
if (!empty($_GET['srv'])) {
10-
$v_service = escapeshellarg($_GET['srv']);
11-
exec (VESTA_CMD."v-restart-service ".$v_service, $output, $return_var);
10+
if ($_GET['srv'] == 'iptables') {
11+
exec (VESTA_CMD."v-update-firewall", $output, $return_var);
12+
} else {
13+
$v_service = escapeshellarg($_GET['srv']);
14+
exec (VESTA_CMD."v-restart-service ".$v_service, $output, $return_var);
15+
}
1216
}
1317
if ($return_var != 0) {
1418
$error = implode('<br>', $output);

web/start/service/index.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77

88
if ($_SESSION['user'] == 'admin') {
99
if (!empty($_GET['srv'])) {
10-
$v_service = escapeshellarg($_GET['srv']);
11-
exec (VESTA_CMD."v-start-service ".$v_service, $output, $return_var);
10+
if ($_GET['srv'] == 'iptables') {
11+
exec (VESTA_CMD."v-update-firewall", $output, $return_var);
12+
} else {
13+
$v_service = escapeshellarg($_GET['srv']);
14+
exec (VESTA_CMD."v-start-service ".$v_service, $output, $return_var);
15+
}
1216
}
1317
if ($return_var != 0) {
1418
$error = implode('<br>', $output);

web/stop/service/index.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77

88
if ($_SESSION['user'] == 'admin') {
99
if (!empty($_GET['srv'])) {
10-
$v_service = escapeshellarg($_GET['srv']);
11-
exec (VESTA_CMD."v-stop-service ".$v_service, $output, $return_var);
10+
if ($_GET['srv'] == 'iptables') {
11+
exec (VESTA_CMD."v-stop-firewall", $output, $return_var);
12+
} else {
13+
$v_service = escapeshellarg($_GET['srv']);
14+
exec (VESTA_CMD."v-stop-service ".$v_service, $output, $return_var);
15+
}
1216
}
1317
if ($return_var != 0) {
1418
$error = implode('<br>', $output);

0 commit comments

Comments
 (0)