Permalink
Browse files

nginx restart trigger

  • Loading branch information...
serghey-rodin committed Feb 6, 2014
1 parent 4779348 commit 11a27358d2236dbe1633eb8cb88752dcc0a7900c
Showing with 13 additions and 0 deletions.
  1. +13 −0 web/edit/web/index.php
View
@@ -97,6 +97,7 @@
exec (VESTA_CMD."v-change-web-domain-ip ".$v_username." ".$v_domain." ".$v_ip." 'no'", $output, $return_var);
check_return_code($return_var,$output);
$restart_web = 'yes';
$restart_proxy = 'yes';
unset($output);
exec (VESTA_CMD."v-list-dns-domain ".$v_username." ".$v_domain." json", $output, $return_var);
if ((empty($_SESSION['error_msg'])) && ($return_var == 0 )) {
@@ -138,6 +139,7 @@
foreach ($result as $alias) {
if ((empty($_SESSION['error_msg'])) && (!empty($alias))) {
$restart_web = 'yes';
$restart_proxy = 'yes';
$v_template = escapeshellarg($_POST['v_template']);
exec (VESTA_CMD."v-delete-web-domain-alias ".$v_username." ".$v_domain." '".$alias."' 'no'", $output, $return_var);
check_return_code($return_var,$output);
@@ -160,6 +162,7 @@
foreach ($result as $alias) {
if ((empty($_SESSION['error_msg'])) && (!empty($alias))) {
$restart_web = 'yes';
$restart_proxy = 'yes';
$v_template = escapeshellarg($_POST['v_template']);
exec (VESTA_CMD."v-add-web-domain-alias ".$v_username." ".$v_domain." '".$alias."' 'no'", $output, $return_var);
check_return_code($return_var,$output);
@@ -225,6 +228,7 @@
unset($output);
$v_ssl = 'no';
$restart_web = 'yes';
$restart_proxy = 'yes';
}
if (($v_ssl == 'yes') && (!empty($_POST['v_ssl'])) && (empty($_SESSION['error_msg']))) {
if (( $v_ssl_crt != str_replace("\r\n", "\n", $_POST['v_ssl_crt'])) || ( $v_ssl_key != str_replace("\r\n", "\n", $_POST['v_ssl_key'])) || ( $v_ssl_ca != str_replace("\r\n", "\n", $_POST['v_ssl_ca']))) {
@@ -259,6 +263,7 @@
check_return_code($return_var,$output);
unset($output);
$restart_web = 'yes';
$restart_proxy = 'yes';
$v_ssl_crt = $_POST['v_ssl_crt'];
$v_ssl_key = $_POST['v_ssl_key'];
$v_ssl_ca = $_POST['v_ssl_ca'];
@@ -316,6 +321,7 @@
unset($output);
$v_ssl = 'yes';
$restart_web = 'yes';
$restart_proxy = 'yes';
$v_ssl_crt = $_POST['v_ssl_crt'];
$v_ssl_key = $_POST['v_ssl_key'];
$v_ssl_ca = $_POST['v_ssl_ca'];
@@ -474,6 +480,13 @@
unset($output);
}
// Restart proxy
if (!empty($restart_proxy) && (empty($_SESSION['error_msg']))) {
exec (VESTA_CMD."v-restart-proxy", $output, $return_var);
check_return_code($return_var,$output);
unset($output);
}
// Restart dns
if (!empty($restart_dns) && (empty($_SESSION['error_msg']))) {
exec (VESTA_CMD."v-restart-dns", $output, $return_var);

0 comments on commit 11a2735

Please sign in to comment.