From 51be240bd487b5aefe2492316cedfd8d3ebc563e Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 9 Nov 2016 17:45:43 +0200 Subject: [PATCH] smarter way to use restart command in other scripts --- bin/v-list-user-log | 1 - bin/v-restart-cron | 5 +++++ bin/v-restart-dns | 5 +++++ bin/v-restart-ftp | 5 +++++ bin/v-restart-mail | 5 +++++ bin/v-restart-proxy | 5 +++++ bin/v-restart-web | 5 +++++ bin/v-restart-web-backend | 5 +++++ 8 files changed, 35 insertions(+), 1 deletion(-) diff --git a/bin/v-list-user-log b/bin/v-list-user-log index f8581341a..5f0b9004b 100755 --- a/bin/v-list-user-log +++ b/bin/v-list-user-log @@ -24,7 +24,6 @@ json_list() { echo "{" for str in $logs; do eval $str - CMD=${CMD//\"/\\\"} echo -n ' "'$ID'": { "CMD": "'$CMD'", "UNDO": "'$UNDO'", diff --git a/bin/v-restart-cron b/bin/v-restart-cron index 305f2db21..ac9ea8b1a 100755 --- a/bin/v-restart-cron +++ b/bin/v-restart-cron @@ -30,6 +30,11 @@ send_email_report() { # Action # #----------------------------------------------------------# +# Exit +if [ "$1" = "no" ]; then + exit +fi + # Schedule restart if [ "$1" = 'scheduled' ]; then echo "$BIN/$SCRIPT now" >> $VESTA/data/queue/restart.pipe diff --git a/bin/v-restart-dns b/bin/v-restart-dns index fad2f7049..4e7712a7c 100755 --- a/bin/v-restart-dns +++ b/bin/v-restart-dns @@ -35,6 +35,11 @@ send_email_report() { # Action # #----------------------------------------------------------# +# Exit +if [ "$1" = "no" ]; then + exit +fi + # Schedule restart if [ "$1" = 'scheduled' ]; then echo "$BIN/$SCRIPT now" >> $VESTA/data/queue/restart.pipe diff --git a/bin/v-restart-ftp b/bin/v-restart-ftp index f554011c4..2f1eab35d 100755 --- a/bin/v-restart-ftp +++ b/bin/v-restart-ftp @@ -30,6 +30,11 @@ send_email_report() { # Action # #----------------------------------------------------------# +# Exit +if [ "$1" = "no" ]; then + exit +fi + # Schedule restart if [ "$1" = 'scheduled' ]; then echo "$BIN/$SCRIPT now" >> $VESTA/data/queue/restart.pipe diff --git a/bin/v-restart-mail b/bin/v-restart-mail index 7080260ee..920297227 100755 --- a/bin/v-restart-mail +++ b/bin/v-restart-mail @@ -30,6 +30,11 @@ send_email_report() { # Action # #----------------------------------------------------------# +# Exit +if [ "$1" = "no" ]; then + exit +fi + # Schedule restart if [ "$1" = 'scheduled' ]; then echo "$BIN/$SCRIPT now" >> $VESTA/data/queue/restart.pipe diff --git a/bin/v-restart-proxy b/bin/v-restart-proxy index e050eb1cf..25ab20bf1 100755 --- a/bin/v-restart-proxy +++ b/bin/v-restart-proxy @@ -30,6 +30,11 @@ send_email_report() { # Action # #----------------------------------------------------------# +# Exit +if [ "$1" = "no" ]; then + exit +fi + # Schedule restart if [ "$1" = 'scheduled' ]; then echo "$BIN/$SCRIPT now" >> $VESTA/data/queue/restart.pipe diff --git a/bin/v-restart-web b/bin/v-restart-web index a7ecf6445..ab1afe6ce 100755 --- a/bin/v-restart-web +++ b/bin/v-restart-web @@ -30,6 +30,11 @@ send_email_report() { # Action # #----------------------------------------------------------# +# Exit +if [ "$1" = "no" ]; then + exit +fi + # Schedule restart if [ "$1" = 'scheduled' ]; then echo "$BIN/$SCRIPT now" >> $VESTA/data/queue/restart.pipe diff --git a/bin/v-restart-web-backend b/bin/v-restart-web-backend index 50cd940ff..2d392c45f 100755 --- a/bin/v-restart-web-backend +++ b/bin/v-restart-web-backend @@ -30,6 +30,11 @@ send_email_report() { # Action # #----------------------------------------------------------# +# Exit +if [ "$1" = "no" ]; then + exit +fi + # Schedule restart if [ "$1" = 'scheduled' ]; then echo "$BIN/$SCRIPT now" >> $VESTA/data/queue/restart.pipe