v-restart-system 1012 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/bash
  2. # info: restart operating system
  3. # options: restart
  4. #
  5. # The function restarts operating system.
  6. #----------------------------------------------------------#
  7. # Variable&Function #
  8. #----------------------------------------------------------#
  9. # Argument definition
  10. restart=$1
  11. # Includes
  12. source $VESTA/func/main.sh
  13. #----------------------------------------------------------#
  14. # Verifications #
  15. #----------------------------------------------------------#
  16. check_args '1' "$#" 'RESTART'
  17. #----------------------------------------------------------#
  18. # Action #
  19. #----------------------------------------------------------#
  20. if [ "$restart" = 'yes' ]; then
  21. /sbin/reboot
  22. fi
  23. #----------------------------------------------------------#
  24. # Vesta #
  25. #----------------------------------------------------------#
  26. exit