| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- #!/bin/bash
- # info: restart dns service
- # options: none
- #
- # The function tells BIND service to reload dns zone files.
- #----------------------------------------------------------#
- # Variable&Function #
- #----------------------------------------------------------#
- # Importing variables
- source $VESTA/conf/vars.conf
- source $V_CONF/vesta.conf
- # Restart functions
- apache() {
- /etc/init.d/httpd status >/dev/null 2>&1
- if [ $? -eq 0 ]; then
- /etc/init.d/httpd graceful >/dev/null 2>&1
- if [ $? -ne 0 ]; then
- echo "$E_RESTART $1"
- exit $E_RESTART
- fi
- else
- /etc/init.d/httpd start >/dev/null 2>&1
- if [ $? -ne 0 ]; then
- echo "$E_RESTART $1"
- exit $E_RESTART
- fi
- fi
- }
- nginx() {
- /etc/init.d/nginx status >/dev/null 2>&1
- if [ $? -eq 0 ]; then
- /etc/init.d/nginx reload >/dev/null 2>&1
- if [ $? -ne 0 ]; then
- echo "$E_RESTART $1"
- exit $E_RESTART
- fi
- else
- /etc/init.d/nginx start >/dev/null 2>&1
- if [ $? -ne 0 ]; then
- echo "$E_RESTART $1"
- exit $E_RESTART
- fi
- fi
- }
- #----------------------------------------------------------#
- # Action #
- #----------------------------------------------------------#
- # Checking system
- if [ "$WEB_SYSTEM" = 'apache' ]; then
- apache $1
- fi
- if [ "$PROXY_SYSTEM" = 'nginx' ]; then
- nginx $1
- fi
- #----------------------------------------------------------#
- # Vesta #
- #----------------------------------------------------------#
- # Logging
- exit
|