| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237 |
- #!/bin/bash
- # LGSM fn_getopt function
- # Author: Daniel Gibbs
- # Website: http://gameservermanagers.com
- # Version: 250515
- # Description: getopt arguments.
- fn_getopt_generic(){
- case "$getopt" in
- start)
- fn_start;;
- stop)
- fn_stop;;
- restart)
- fn_restart;;
- update)
- fn_update_check;;
- force-update)
- forceupdate=1;
- fn_update_check;;
- update-restart)
- forceupdate=1;
- fn_update_check;;
- update-functions)
- fn_update_functions;;
- validate)
- fn_validate;;
- monitor)
- fn_monitor;;
- email-test)
- fn_email_test;;
- details)
- fn_details;;
- backup)
- fn_backup;;
- console)
- fn_console;;
- debug)
- fn_debug;;
- install)
- fn_install;;
- auto-install)
- fn_autoinstall;;
- *)
- echo "Usage: $0 {start|stop|restart|update|force-update|update-functions|validate|monitor|email-test|details|backup|console|debug|install|auto-install}"
- exit 1;;
- esac
- exit
- }
- fn_getopt_teamspeak3(){
- case "$getopt" in
- start)
- fn_start;;
- stop)
- fn_stop;;
- restart)
- fn_restart;;
- update)
- fn_update_check;;
- update-functions)
- fn_update_functions;;
- monitor)
- fn_monitor;;
- email-test)
- fn_email_test;;
- details)
- fn_details;;
- backup)
- fn_backup;;
- install)
- fn_install;;
- auto-install)
- fn_autoinstall;;
- *)
- echo "Usage: $0 {start|stop|restart|update|update-functions|monitor|email-test|details|backup|install|auto-install}"
- exit 1;;
- esac
- exit
- }
- fn_getopt_mumble(){
- case "$getopt" in
- start)
- fn_start;;
- stop)
- fn_stop;;
- restart)
- fn_restart;;
- update-functions)
- fn_update_functions;;
- monitor)
- fn_monitor;;
- email-test)
- fn_email_test;;
- backup)
- fn_backup;;
- console)
- fn_console;;
- debug)
- fn_debug;;
- *)
- echo "Usage: $0 {start|stop|restart|update-functions|monitor|email-test|backup|console|debug}"
- exit 1;;
- esac
- exit
- }
- fn_getopt_unreal(){
- case "$getopt" in
- start)
- fn_start;;
- stop)
- fn_stop;;
- restart)
- fn_restart;;
- update-functions)
- fn_update_functions;;
- monitor)
- fn_monitor;;
- email-test)
- fn_email_test;;
- details)
- fn_details;;
- backup)
- fn_backup;;
- console)
- fn_console;;
- debug)
- fn_debug;;
- install)
- fn_install;;
- map-compressor)
- fn_compress_ut99maps;;
- *)
- echo "Usage: $0 {start|stop|restart|update-functions|monitor|email-test|details|backup|console|debug|install|map-compressor}"
- exit 1;;
- esac
- exit
- }
- fn_getopt_unreal2(){
- case "$getopt" in
- start)
- fn_start;;
- stop)
- fn_stop;;
- restart)
- fn_restart;;
- update)
- fn_update_check;;
- force-update)
- forceupdate=1;
- fn_update_check;;
- update-restart)
- forceupdate=1;
- fn_update_check;;
- update-functions)
- fn_update_functions;;
- validate)
- fn_validate;;
- monitor)
- fn_monitor;;
- email-test)
- fn_email_test;;
- details)
- fn_details;;
- backup)
- fn_backup;;
- console)
- fn_console;;
- debug)
- fn_debug;;
- install)
- fn_install;;
- auto-install)
- fn_autoinstall;;
- map-compressor)
- fn_compress_unreal2maps;;
- *)
- echo "Usage: $0 {start|stop|restart|update|update-functions|validate|monitor|email-test|details|backup|console|debug|install|auto-install|map-compressor}"
- exit 1;;
- esac
- exit
- }
- fn_getopt_ut2k4(){
- case "$getopt" in
- start)
- fn_start;;
- stop)
- fn_stop;;
- restart)
- fn_restart;;
- update-functions)
- fn_update_functions;;
- monitor)
- fn_monitor;;
- email-test)
- fn_email_test;;
- details)
- fn_details;;
- backup)
- fn_backup;;
- console)
- fn_console;;
- debug)
- fn_debug;;
- install)
- fn_install;;
- map-compressor)
- fn_compress_unreal2maps;;
- *)
- echo "Usage: $0 {start|stop|restart|update-functions|monitor|email-test|details|backup|console|debug|install|map-compressor}"
- exit 1;;
- esac
- exit
- }
- if [ "${gamename}" == "Mumble" ]; then
- fn_getopt_mumble
- elif [ "${gamename}" == "Teamspeak 3" ]; then
- fn_getopt_teamspeak3
- elif [ "${engine}" == "unreal2" ]; then
- if [ "${gamename}" == "Unreal Tournament 2004" ]; then
- fn_getopt_ut2k4
- else
- fn_getopt_unreal2
- fi
- elif [ "${engine}" == "unreal" ]; then
- fn_getopt_unreal
- else
- fn_getopt_generic
- fi
|