forked from hestiacp/hestiacp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrestart_web
More file actions
executable file
·39 lines (32 loc) · 799 Bytes
/
restart_web
File metadata and controls
executable file
·39 lines (32 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
# Internal vesta function
# web system restart
# Importing variables
source $VESTA/conf/vars.conf
# Restart functions
apache() {
/etc/init.d/httpd 'graceful' >/dev/null 2>&1
if [ $? -ne 0 ]; then
#$V_FUNC/report_issue 'web' 'apache'
echo "$E_RESTART_FAILED $V_EVENT"
fi
}
nginx() {
/etc/init.d/nginx 'reload' >/dev/null 2>&1
if [ $? -ne 0 ]; then
#$V_FUNC/report_issue 'web' 'nginx'
echo "$E_RESTART_FAILED $V_EVENT"
fi
}
# Parsing config
web_system=$(grep 'WEB_SYSTEM=' $V_CONF/vesta.conf | cut -f 2 -d \' )
proxy_system=$(grep 'PROXY_SYSTEM=' $V_CONF/vesta.conf | cut -f 2 -d \' )
# Checking values
if [ "$web_system" = 'apache' ]; then
apache
fi
if [ "$proxy_system" = 'nginx' ]; then
nginx
fi
# Logging
exit $OK