v-start-service 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. # info: start service
  3. # options: service
  4. #
  5. # The function starts 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 [ "$service" != 'iptables' ]; then
  21. service $service start >/dev/null 2>&1
  22. if [ $? -ne 0 ]; then
  23. exit $E_RESTART
  24. fi
  25. else
  26. $BIN/v-update-firewall
  27. if [ $? -ne 0 ]; then
  28. exit $E_RESTART
  29. fi
  30. fi
  31. #----------------------------------------------------------#
  32. # Vesta #
  33. #----------------------------------------------------------#
  34. exit