v-restart-proxy 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. # info: restart proxy server
  3. # options: NONE
  4. #
  5. # The function reloads proxy server configuration.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Includes
  10. source $VESTA/conf/vesta.conf
  11. source $VESTA/func/main.sh
  12. #----------------------------------------------------------#
  13. # Action #
  14. #----------------------------------------------------------#
  15. if [ ! -z "$PROXY_SYSTEM" ]; then
  16. /etc/init.d/$PROXY_SYSTEM status >/dev/null 2>&1
  17. if [ $? -eq 0 ]; then
  18. /etc/init.d/$PROXY_SYSTEM reload >/dev/null 2>&1
  19. if [ $? -ne 0 ]; then
  20. exit $E_RESTART
  21. fi
  22. else
  23. /etc/init.d/$PROXY_SYSTEM start >/dev/null 2>&1
  24. if [ $? -ne 0 ]; then
  25. exit $E_RESTART
  26. fi
  27. fi
  28. fi
  29. #----------------------------------------------------------#
  30. # Vesta #
  31. #----------------------------------------------------------#
  32. exit