Skip to content

Commit

Permalink
nginx restart trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
serghey-rodin committed Feb 6, 2014
1 parent 4779348 commit 11a2735
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions web/edit/web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 )) {
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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']))) {
Expand Down Expand Up @@ -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'];
Expand Down Expand Up @@ -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'];
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 11a2735

Please sign in to comment.