Skip to content

Commit 7c52a77

Browse files
author
Kristan Kenney
committed
Clean up formatting in v-restart-proxy
1 parent fe41a30 commit 7c52a77

File tree

1 file changed

+25
-41
lines changed

1 file changed

+25
-41
lines changed

bin/v-restart-proxy

Lines changed: 25 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -50,47 +50,31 @@ if [ -z "$PROXY_SYSTEM" ] || [ "$PROXY_SYSTEM" = 'remote' ]; then
5050
fi
5151

5252
if [ -f "$HESTIA/web/inc/nginx_proxy" ]; then
53-
54-
# if hestia is behind default nginx, restart in background with 15 sec delay
55-
# background restart
56-
if [ "$1" = 'background' ]; then
57-
# Restart system
58-
sleep 15
59-
service $PROXY_SYSTEM restart >/dev/null 2>&1
60-
#if [ $? -ne 0 ]; then
61-
# send_email_report
62-
# check_result $E_RESTART "$PROXY_SYSTEM restart failed"
63-
#fi
64-
65-
# Update restart queue
66-
if [ -e "$HESTIA/data/queue/restart.pipe" ]; then
67-
sed -i "/$SCRIPT/d" $HESTIA/data/queue/restart.pipe
68-
fi
69-
70-
exit;
71-
fi
72-
73-
# try to reload to get changes faster
74-
service $PROXY_SYSTEM reload
75-
76-
# send to background process
77-
nohup $BIN/v-restart-proxy 'background' &>/dev/null &
78-
79-
else
80-
81-
# Default behaviour
82-
# Restart system
83-
service $PROXY_SYSTEM restart >/dev/null 2>&1
84-
#if [ $? -ne 0 ]; then
85-
# send_email_report
86-
# check_result $E_RESTART "$PROXY_SYSTEM restart failed"
87-
#fi
88-
89-
# Update restart queue
90-
if [ -e "$HESTIA/data/queue/restart.pipe" ]; then
91-
sed -i "/$SCRIPT/d" $HESTIA/data/queue/restart.pipe
92-
fi
93-
53+
# if hestia is behind default nginx, restart in background with 15 sec delay
54+
# background restart
55+
if [ "$1" = 'background' ]; then
56+
# Restart system
57+
sleep 15
58+
$BIN/v-restart-service $PROXY_SYSTEM > /dev/null 2>&1
59+
60+
# Update restart queue
61+
if [ -e "$HESTIA/data/queue/restart.pipe" ]; then
62+
sed -i "/$SCRIPT/d" $HESTIA/data/queue/restart.pipe
63+
fi
64+
65+
exit;
66+
fi
67+
# Send to background process
68+
nohup $BIN/v-restart-proxy 'background' &>/dev/null &
69+
else
70+
# Default behaviour
71+
# Restart system
72+
$BIN/v-restart-service $PROXY_SYSTEM > /dev/null 2>&1
73+
74+
# Update restart queue
75+
if [ -e "$HESTIA/data/queue/restart.pipe" ]; then
76+
sed -i "/$SCRIPT/d" $HESTIA/data/queue/restart.pipe
77+
fi
9478
fi
9579

9680
#----------------------------------------------------------#

0 commit comments

Comments
 (0)