fn_getopt 785 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/bin/bash
  2. # LGSM fn_getopt function
  3. # Author: Daniel Gibbs
  4. # Website: http://danielgibbs.co.uk
  5. # Version: 190115
  6. # Description: getopt arguments.
  7. case "$getopt" in
  8. start)
  9. fn_start;;
  10. stop)
  11. fn_stop;;
  12. restart)
  13. fn_restart;;
  14. update)
  15. norestart=1;
  16. fn_update_check;;
  17. update-restart)
  18. fn_update_check;;
  19. validate)
  20. fn_validate;;
  21. validate-restart)
  22. fn_stop
  23. fn_validate
  24. fn_start;;
  25. monitor)
  26. fn_monitor;;
  27. email-test)
  28. fn_email_test;;
  29. details)
  30. fn_details;;
  31. backup)
  32. fn_backup;;
  33. console)
  34. fn_console;;
  35. debug)
  36. fn_debug;;
  37. install)
  38. fn_install;;
  39. auto-install)
  40. fn_autoinstall;;
  41. *)
  42. echo "Usage: $0 {start|stop|restart|update|update-restart|validate|validate-restart|monitor|email-test|details|backup|console|debug|install|auto-install}"
  43. exit 1;;
  44. esac
  45. exit