v-stop-service 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/bin/bash
  2. # info: stop service
  3. # options: service
  4. #
  5. # The function stops system service.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Argument defenition
  10. service=$1
  11. # Includes
  12. source $VESTA/func/main.sh
  13. #----------------------------------------------------------#
  14. # Verifications #
  15. #----------------------------------------------------------#
  16. check_args '1' "$#" 'SERVICE'
  17. #----------------------------------------------------------#
  18. # Action #
  19. #----------------------------------------------------------#
  20. if [ -x "/etc/init.d/$service" ]; then
  21. /etc/init.d/$service stop >/dev/null 2>&1
  22. if [ $? -ne 0 ]; then
  23. exit $E_RESTART
  24. fi
  25. fi
  26. #----------------------------------------------------------#
  27. # Vesta #
  28. #----------------------------------------------------------#
  29. exit