v-stop-service 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. # info: stop service
  3. # options: service
  4. #
  5. # The function stops system service.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Argument definition
  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 [ "$service" != 'iptables' ]; then
  21. service $service stop >/dev/null 2>&1
  22. check_result $? "$service stop failed" $E_RESTART
  23. else
  24. $BIN/v-stop-firewall
  25. check_result $? "$service stop failed" $E_RESTART
  26. fi
  27. #----------------------------------------------------------#
  28. # Vesta #
  29. #----------------------------------------------------------#
  30. exit