core_getopt.sh 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641
  1. #!/bin/bash
  2. # LGSM core_getopt.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://gameservermanagers.com
  5. # Description: getopt arguments.
  6. local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  7. fn_getopt_generic(){
  8. case "${getopt}" in
  9. st|start)
  10. command_start.sh;;
  11. sp|stop)
  12. command_stop.sh;;
  13. r|restart)
  14. command_restart.sh;;
  15. u|update)
  16. command_update.sh;;
  17. fu|force-update|update-restart)
  18. forceupdate=1;
  19. command_update.sh;;
  20. uf|update-functions)
  21. command_update_functions.sh;;
  22. v|validate)
  23. command_validate.sh;;
  24. m|monitor)
  25. command_monitor.sh;;
  26. ta|test-alert)
  27. command_test_alert.sh;;
  28. dt|details)
  29. command_details.sh;;
  30. pd|postdetails)
  31. command_postdetails.sh;;
  32. b|backup)
  33. command_backup.sh;;
  34. c|console)
  35. command_console.sh;;
  36. d|debug)
  37. command_debug.sh;;
  38. dev|dev-debug)
  39. command_dev_debug.sh;;
  40. i|install)
  41. command_install.sh;;
  42. ai|auto-install)
  43. fn_autoinstall;;
  44. dd|detect-deps)
  45. command_dev_detect_deps.sh;;
  46. dg|detect-glibc)
  47. command_dev_detect_glibc.sh;;
  48. dl|detect-ldd)
  49. command_dev_detect_ldd.sh;;
  50. *)
  51. if [ -n "${getopt}" ]; then
  52. echo -e "${red}Unknown command${default}: $0 ${getopt}"
  53. exitcode=2
  54. fi
  55. echo "Usage: $0 [option]"
  56. echo "${gamename} - Linux Game Server Manager - Version ${version}"
  57. echo "https://gameservermanagers.com/${selfname}"
  58. echo -e ""
  59. echo -e "${lightyellow}Commands${default}"
  60. {
  61. echo -e "${blue}start\t${default}st |Start the server."
  62. echo -e "${blue}stop\t${default}sp |Stop the server."
  63. echo -e "${blue}restart\t${default}r |Restart the server."
  64. echo -e "${blue}update\t${default}u |Checks and applies updates from SteamCMD."
  65. echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD."
  66. echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded."
  67. echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD."
  68. echo -e "${blue}monitor\t${default}m |Checks that the server is running."
  69. echo -e "${blue}test-alert\t${default}ta |Sends test alert."
  70. echo -e "${blue}details\t${default}dt |Displays useful information about the server."
  71. echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)"
  72. echo -e "${blue}backup\t${default}b |Create archive of the server."
  73. echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server."
  74. echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal."
  75. echo -e "${blue}install\t${default}i |Install the server."
  76. echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts."
  77. } | column -s $'\t' -t
  78. esac
  79. }
  80. fn_getopt_bf1942(){
  81. case "${getopt}" in
  82. st|start)
  83. command_start.sh;;
  84. sp|stop)
  85. command_stop.sh;;
  86. r|restart)
  87. command_restart.sh;;
  88. uf|update-functions)
  89. command_update_functions.sh;;
  90. m|monitor)
  91. command_monitor.sh;;
  92. ta|test-alert)
  93. command_test_alert.sh;;
  94. dt|details)
  95. command_details.sh;;
  96. pd|postdetails)
  97. command_postdetails.sh;;
  98. b|backup)
  99. command_backup.sh;;
  100. c|console)
  101. command_console.sh;;
  102. d|debug)
  103. command_debug.sh;;
  104. dev|dev-debug)
  105. command_dev_debug.sh;;
  106. i|install)
  107. command_install.sh;;
  108. ai|auto-install)
  109. fn_autoinstall;;
  110. dd|detect-deps)
  111. command_dev_detect_deps.sh;;
  112. dg|detect-glibc)
  113. command_dev_detect_glibc.sh;;
  114. dl|detect-ldd)
  115. command_dev_detect_ldd.sh;;
  116. *)
  117. if [ -n "${getopt}" ]; then
  118. echo -e "${red}Unknown command${default}: $0 ${getopt}"
  119. exitcode=2
  120. fi
  121. echo "Usage: $0 [option]"
  122. echo "${gamename} - Linux Game Server Manager - Version ${version}"
  123. echo "https://gameservermanagers.com/${selfname}"
  124. echo -e ""
  125. echo -e "${lightyellow}Commands${default}"
  126. {
  127. echo -e "${blue}start\t${default}st |Start the server."
  128. echo -e "${blue}stop\t${default}sp |Stop the server."
  129. echo -e "${blue}restart\t${default}r |Restart the server."
  130. echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded."
  131. echo -e "${blue}monitor\t${default}m |Checks that the server is running."
  132. echo -e "${blue}test-alert\t${default}ta |Sends test alert."
  133. echo -e "${blue}details\t${default}dt |Displays useful infomation about the server."
  134. echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)"
  135. echo -e "${blue}backup\t${default}b |Create archive of the server."
  136. echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server."
  137. echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal."
  138. echo -e "${blue}install\t${default}i |Install the server."
  139. echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts."
  140. } | column -s $'\t' -t
  141. esac
  142. }
  143. fn_getopt_teamspeak3(){
  144. case "${getopt}" in
  145. st|start)
  146. command_start.sh;;
  147. sp|stop)
  148. command_stop.sh;;
  149. r|restart)
  150. command_restart.sh;;
  151. u|update)
  152. command_update.sh;;
  153. uf|update-functions)
  154. command_update_functions.sh;;
  155. m|monitor)
  156. command_monitor.sh;;
  157. ta|test-alert)
  158. command_test_alert.sh;;
  159. dt|details)
  160. command_details.sh;;
  161. pd|postdetails)
  162. command_postdetails.sh;;
  163. b|backup)
  164. command_backup.sh;;
  165. pw|change-password)
  166. command_ts3_server_pass.sh;;
  167. dev|dev-debug)
  168. command_dev_debug.sh;;
  169. i|install)
  170. command_install.sh;;
  171. ai|auto-install)
  172. fn_autoinstall;;
  173. dd|detect-deps)
  174. command_dev_detect_deps.sh;;
  175. dg|detect-glibc)
  176. command_dev_detect_glibc.sh;;
  177. dl|detect-ldd)
  178. command_dev_detect_ldd.sh;;
  179. *)
  180. if [ -n "${getopt}" ]; then
  181. echo -e "${red}Unknown command${default}: $0 ${getopt}"
  182. exitcode=2
  183. fi
  184. echo "Usage: $0 [option]"
  185. echo "${gamename} - Linux Game Server Manager - Version ${version}"
  186. echo "https://gameservermanagers.com/${selfname}"
  187. echo -e ""
  188. echo -e "${lightyellow}Commands${default}"
  189. {
  190. echo -e "${blue}start\t${default}st |Start the server."
  191. echo -e "${blue}stop\t${default}sp |Stop the server."
  192. echo -e "${blue}restart\t${default}r |Restart the server."
  193. echo -e "${blue}update\t${default}u |Checks and applies updates from teamspeak.com."
  194. echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded."
  195. echo -e "${blue}monitor\t${default}m |Checks that the server is running."
  196. echo -e "${blue}test-alert\t${default}ta |Sends test alert."
  197. echo -e "${blue}details\t${default}dt |Displays useful information about the server."
  198. echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)"
  199. echo -e "${blue}change-password\t${default}pw |Changes TS3 serveradmin password."
  200. echo -e "${blue}backup\t${default}b |Create archive of the server."
  201. echo -e "${blue}install\t${default}i |Install the server."
  202. echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts."
  203. } | column -s $'\t' -t
  204. esac
  205. }
  206. fn_getopt_minecraft(){
  207. case "${getopt}" in
  208. st|start)
  209. command_start.sh;;
  210. sp|stop)
  211. command_stop.sh;;
  212. r|restart)
  213. command_restart.sh;;
  214. u|update)
  215. command_update.sh;;
  216. uf|update-functions)
  217. command_update_functions.sh;;
  218. m|monitor)
  219. command_monitor.sh;;
  220. ta|test-alert)
  221. command_test_alert.sh;;
  222. dt|details)
  223. command_details.sh;;
  224. pd|postdetails)
  225. command_postdetails.sh;;
  226. b|backup)
  227. command_backup.sh;;
  228. c|console)
  229. command_console.sh;;
  230. d|debug)
  231. command_debug.sh;;
  232. dev|dev-debug)
  233. command_dev_debug.sh;;
  234. i|install)
  235. command_install.sh;;
  236. ai|auto-install)
  237. fn_autoinstall;;
  238. dd|detect-deps)
  239. command_dev_detect_deps.sh;;
  240. dg|detect-glibc)
  241. command_dev_detect_glibc.sh;;
  242. dl|detect-ldd)
  243. command_dev_detect_ldd.sh;;
  244. *)
  245. if [ -n "${getopt}" ]; then
  246. echo -e "${red}Unknown command${default}: $0 ${getopt}"
  247. exitcode=2
  248. fi
  249. echo "Usage: $0 [option]"
  250. echo "${gamename} - Linux Game Server Manager - Version ${version}"
  251. echo "https://gameservermanagers.com/${selfname}"
  252. echo -e ""
  253. echo -e "${lightyellow}Commands${default}"
  254. {
  255. echo -e "${blue}start\t${default}st |Start the server."
  256. echo -e "${blue}stop\t${default}sp |Stop the server."
  257. echo -e "${blue}restart\t${default}r |Restart the server."
  258. echo -e "${blue}update\t${default}u |Checks and applies updates from mojang.com."
  259. echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded."
  260. echo -e "${blue}monitor\t${default}m |Checks that the server is running."
  261. echo -e "${blue}test-alert\t${default}ta |Sends test alert."
  262. echo -e "${blue}details\t${default}dt |Displays useful infomation about the server."
  263. echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)"
  264. echo -e "${blue}backup\t${default}b |Create archive of the server."
  265. echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server."
  266. echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal."
  267. echo -e "${blue}install\t${default}i |Install the server."
  268. echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts."
  269. } | column -s $'\t' -t
  270. esac
  271. }
  272. fn_getopt_mumble(){
  273. case "${getopt}" in
  274. st|start)
  275. command_start.sh;;
  276. sp|stop)
  277. command_stop.sh;;
  278. r|restart)
  279. command_restart.sh;;
  280. u|update)
  281. command_update.sh;;
  282. uf|update-functions)
  283. command_update_functions.sh;;
  284. m|monitor)
  285. command_monitor.sh;;
  286. ta|test-alert)
  287. command_test_alert.sh;;
  288. dt|details)
  289. command_details.sh;;
  290. pd|postdetails)
  291. command_postdetails.sh;;
  292. b|backup)
  293. command_backup.sh;;
  294. dev|dev-debug)
  295. command_dev_debug.sh;;
  296. i|install)
  297. command_install.sh;;
  298. dd|detect-deps)
  299. command_dev_detect_deps.sh;;
  300. dg|detect-glibc)
  301. command_dev_detect_glibc.sh;;
  302. dl|detect-ldd)
  303. command_dev_detect_ldd.sh;;
  304. *)
  305. if [ -n "${getopt}" ]; then
  306. echo -e "${red}Unknown command${default}: $0 ${getopt}"
  307. exitcode=2
  308. fi
  309. echo "Usage: $0 [option]"
  310. echo "${gamename} - Linux Game Server Manager - Version ${version}"
  311. echo "https://gameservermanagers.com/${selfname}"
  312. echo -e ""
  313. echo -e "${lightyellow}Commands${default}"
  314. {
  315. echo -e "${blue}start\t${default}st |Start the server."
  316. echo -e "${blue}stop\t${default}sp |Stop the server."
  317. echo -e "${blue}restart\t${default}r |Restart the server."
  318. echo -e "${blue}update\t${default}u |Checks and applies updates from GitHub."
  319. echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded."
  320. echo -e "${blue}monitor\t${default}m |Checks that the server is running."
  321. echo -e "${blue}test-alert\t${default}ta |Sends test alert."
  322. echo -e "${blue}details\t${default}dt |Displays useful information about the server."
  323. echo -e "${blue}postdetails\t${default}pd |Post stripped details to pastebin (for support)"
  324. echo -e "${blue}backup\t${default}b |Create archive of the server."
  325. echo -e "${blue}install\t${default}i |Install the server."
  326. } | column -s $'\t' -t
  327. esac
  328. }
  329. fn_getopt_gmodserver(){
  330. case "${getopt}" in
  331. st|start)
  332. command_start.sh;;
  333. sp|stop)
  334. command_stop.sh;;
  335. r|restart)
  336. command_restart.sh;;
  337. u|update)
  338. command_update.sh;;
  339. fu|force-update|update-restart)
  340. forceupdate=1;
  341. command_update.sh;;
  342. uf|update-functions)
  343. command_update_functions.sh;;
  344. v|validate)
  345. command_validate.sh;;
  346. m|monitor)
  347. command_monitor.sh;;
  348. ta|test-alert)
  349. command_test_alert.sh;;
  350. dt|details)
  351. command_details.sh;;
  352. pd|postdetails)
  353. command_postdetails.sh;;
  354. b|backup)
  355. command_backup.sh;;
  356. c|console)
  357. command_console.sh;;
  358. d|debug)
  359. command_debug.sh;;
  360. dev|dev-debug)
  361. command_dev_debug.sh;;
  362. i|install)
  363. command_install.sh;;
  364. ai|auto-install)
  365. fn_autoinstall;;
  366. dd|detect-deps)
  367. command_dev_detect_deps.sh;;
  368. dg|detect-glibc)
  369. command_dev_detect_glibc.sh;;
  370. dl|detect-ldd)
  371. command_dev_detect_ldd.sh;;
  372. fd|fastdl)
  373. command_fastdl.sh;;
  374. *)
  375. if [ -n "${getopt}" ]; then
  376. echo -e "${red}Unknown command${default}: $0 ${getopt}"
  377. exitcode=2
  378. fi
  379. echo "Usage: $0 [option]"
  380. echo "${gamename} - Linux Game Server Manager - Version ${version}"
  381. echo "https://gameservermanagers.com/${selfname}"
  382. echo -e ""
  383. echo -e "${lightyellow}Commands${default}"
  384. {
  385. echo -e "${blue}start\t${default}st |Start the server."
  386. echo -e "${blue}stop\t${default}sp |Stop the server."
  387. echo -e "${blue}restart\t${default}r |Restart the server."
  388. echo -e "${blue}update\t${default}u |Checks and applies updates from SteamCMD."
  389. echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD."
  390. echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded."
  391. echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD."
  392. echo -e "${blue}monitor\t${default}m |Checks that the server is running."
  393. echo -e "${blue}test-alert\t${default}ta |Sends test alert."
  394. echo -e "${blue}details\t${default}dt |Displays useful information about the server."
  395. echo -e "${blue}backup\t${default}b |Create archive of the server."
  396. echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server."
  397. echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal."
  398. echo -e "${blue}install\t${default}i |Install the server."
  399. echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts."
  400. echo -e "${blue}fastdl\t${default}fd |Generates or update a FastDL folder for your server."
  401. } | column -s $'\t' -t
  402. esac
  403. }
  404. fn_getopt_unreal(){
  405. case "${getopt}" in
  406. st|start)
  407. command_start.sh;;
  408. sp|stop)
  409. command_stop.sh;;
  410. r|restart)
  411. command_restart.sh;;
  412. uf|update-functions)
  413. command_update_functions.sh;;
  414. m|monitor)
  415. command_monitor.sh;;
  416. ta|test-alert)
  417. command_test_alert.sh;;
  418. dt|details)
  419. command_details.sh;;
  420. b|backup)
  421. command_backup.sh;;
  422. c|console)
  423. command_console.sh;;
  424. d|debug)
  425. command_debug.sh;;
  426. dev|dev-debug)
  427. command_dev_debug.sh;;
  428. i|install)
  429. command_install.sh;;
  430. ai|auto-install)
  431. fn_autoinstall;;
  432. mc|map-compressor)
  433. compress_ut99_maps.sh;;
  434. dd|detect-deps)
  435. command_dev_detect_deps.sh;;
  436. dg|detect-glibc)
  437. command_dev_detect_glibc.sh;;
  438. dl|detect-ldd)
  439. command_dev_detect_ldd.sh;;
  440. *)
  441. if [ -n "${getopt}" ]; then
  442. echo -e "${red}Unknown command${default}: $0 ${getopt}"
  443. exitcode=2
  444. fi
  445. echo "Usage: $0 [option]"
  446. echo "${gamename} - Linux Game Server Manager - Version ${version}"
  447. echo "https://gameservermanagers.com/${selfname}"
  448. echo -e ""
  449. echo -e "${lightyellow}Commands${default}"
  450. {
  451. echo -e "${blue}start\t${default}st |Start the server."
  452. echo -e "${blue}stop\t${default}sp |Stop the server."
  453. echo -e "${blue}restart\t${default}r |Restart the server."
  454. echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded."
  455. echo -e "${blue}monitor\t${default}m |Checks that the server is running."
  456. echo -e "${blue}test-alert\t${default}ta |Sends test alert."
  457. echo -e "${blue}details\t${default}dt |Displays useful information about the server."
  458. echo -e "${blue}backup\t${default}b |Create archive of the server."
  459. echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server."
  460. echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal."
  461. echo -e "${blue}install\t${default}i |Install the server."
  462. echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts."
  463. echo -e "${blue}map-compressor\t${default}mc |Compresses all ${gamename} server maps."
  464. } | column -s $'\t' -t
  465. esac
  466. }
  467. fn_getopt_unreal2(){
  468. case "${getopt}" in
  469. st|start)
  470. command_start.sh;;
  471. sp|stop)
  472. command_stop.sh;;
  473. r|restart)
  474. command_restart.sh;;
  475. u|update)
  476. command_update.sh;;
  477. fu|force-update|update-restart)
  478. forceupdate=1;
  479. command_update.sh;;
  480. uf|update-functions)
  481. command_update_functions.sh;;
  482. v|validate)
  483. command_validate.sh;;
  484. m|monitor)
  485. command_monitor.sh;;
  486. ta|test-alert)
  487. command_test_alert.sh;;
  488. dt|details)
  489. command_details.sh;;
  490. b|backup)
  491. command_backup.sh;;
  492. c|console)
  493. command_console.sh;;
  494. d|debug)
  495. command_debug.sh;;
  496. dev|dev-debug)
  497. command_dev_debug.sh;;
  498. i|install)
  499. command_install.sh;;
  500. ai|auto-install)
  501. fn_autoinstall;;
  502. dd|detect-deps)
  503. command_dev_detect_deps.sh;;
  504. dg|detect-glibc)
  505. command_dev_detect_glibc.sh;;
  506. dl|detect-ldd)
  507. command_dev_detect_ldd.sh;;
  508. mc|map-compressor)
  509. compress_unreal2_maps.sh;;
  510. *)
  511. if [ -n "${getopt}" ]; then
  512. echo -e "${red}Unknown command${default}: $0 ${getopt}"
  513. exitcode=2
  514. fi
  515. echo "Usage: $0 [option]"
  516. echo "${gamename} - Linux Game Server Manager - Version ${version}"
  517. echo "https://gameservermanagers.com/${selfname}"
  518. echo -e ""
  519. echo -e "${lightyellow}Commands${default}"
  520. {
  521. echo -e "${blue}start\t${default}st |Start the server."
  522. echo -e "${blue}stop\t${default}sp |Stop the server."
  523. echo -e "${blue}restart\t${default}r |Restart the server."
  524. echo -e "${blue}update\t${default}Checks and applies updates from SteamCMD."
  525. echo -e "${blue}force-update\t${default}fu |Bypasses the check and applies updates from SteamCMD."
  526. echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded."
  527. echo -e "${blue}validate\t${default}v |Validate server files with SteamCMD."
  528. echo -e "${blue}monitor\t${default}m |Checks that the server is running."
  529. echo -e "${blue}test-alert\t${default}ta |Sends test alert."
  530. echo -e "${blue}details\t${default}dt |Displays useful information about the server."
  531. echo -e "${blue}backup\t${default}b |Create archive of the server."
  532. echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server."
  533. echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal."
  534. echo -e "${blue}install\t${default}i |Install the server."
  535. echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts."
  536. echo -e "${blue}map-compressor\t${default}mc |Compresses all ${gamename} server maps."
  537. } | column -s $'\t' -t
  538. esac
  539. }
  540. fn_getopt_ut2k4(){
  541. case "${getopt}" in
  542. st|start)
  543. command_start.sh;;
  544. sp|stop)
  545. command_stop.sh;;
  546. r|restart)
  547. command_restart.sh;;
  548. uf|update-functions)
  549. command_update_functions.sh;;
  550. m|monitor)
  551. command_monitor.sh;;
  552. ta|test-alert)
  553. command_test_alert.sh;;
  554. dt|details)
  555. command_details.sh;;
  556. b|backup)
  557. command_backup.sh;;
  558. c|console)
  559. command_console.sh;;
  560. d|debug)
  561. command_debug.sh;;
  562. dev|dev-debug)
  563. command_dev_debug.sh;;
  564. i|install)
  565. command_install.sh;;
  566. ai|auto-install)
  567. fn_autoinstall;;
  568. cd|server-cd-key)
  569. install_ut2k4_key.sh;;
  570. mc|map-compressor)
  571. compress_unreal2_maps.sh;;
  572. dd|detect-deps)
  573. command_dev_detect_deps.sh;;
  574. dg|detect-glibc)
  575. command_dev_detect_glibc.sh;;
  576. dl|detect-ldd)
  577. command_dev_detect_ldd.sh;;
  578. *)
  579. if [ -n "${getopt}" ]; then
  580. echo -e "${red}Unknown command${default}: $0 ${getopt}"
  581. exitcode=2
  582. fi
  583. echo "Usage: $0 [option]"
  584. echo "${gamename} - Linux Game Server Manager - Version ${version}"
  585. echo "https://gameservermanagers.com/${selfname}"
  586. echo -e ""
  587. echo -e "${lightyellow}Commands${default}"
  588. {
  589. echo -e "${blue}start\t${default}st |Start the server."
  590. echo -e "${blue}stop\t${default}sp |Stop the server."
  591. echo -e "${blue}restart\t${default}r |Restart the server."
  592. echo -e "${blue}update-functions\t${default}uf |Removes all functions so latest can be downloaded."
  593. echo -e "${blue}monitor\t${default}m |Checks that the server is running."
  594. echo -e "${blue}test-alert\t${default}ta |Sends test alert."
  595. echo -e "${blue}details\t${default}dt |Displays useful information about the server."
  596. echo -e "${blue}backup\t${default}b |Create archive of the server."
  597. echo -e "${blue}console\t${default}c |Console allows you to access the live view of a server."
  598. echo -e "${blue}debug\t${default}d |See the output of the server directly to your terminal."
  599. echo -e "${blue}install\t${default}i |Install the server."
  600. echo -e "${blue}auto-install\t${default}ai |Install the server, without prompts."
  601. echo -e "${blue}server-cd-key\t${default}cd |Add your server cd key"
  602. echo -e "${blue}map-compressor\t${default}mc |Compresses all ${gamename} server maps."
  603. } | column -s $'\t' -t
  604. esac
  605. }
  606. if [ "${gamename}" == "Mumble" ]; then
  607. fn_getopt_mumble
  608. elif [ "${gamename}" == "Battlefield: 1942" ]; then
  609. fn_getopt_bf1942
  610. elif [ "${engine}" == "lwjgl2" ]; then
  611. fn_getopt_minecraft
  612. elif [ "${gamename}" == "TeamSpeak 3" ]; then
  613. fn_getopt_teamspeak3
  614. elif [ "${gamename}" == "Garry's Mod" ]; then
  615. fn_getopt_gmodserver
  616. elif [ "${engine}" == "unreal2" ]; then
  617. if [ "${gamename}" == "Unreal Tournament 2004" ]; then
  618. fn_getopt_ut2k4
  619. else
  620. fn_getopt_unreal2
  621. fi
  622. elif [ "${engine}" == "unreal" ]; then
  623. fn_getopt_unreal
  624. else
  625. fn_getopt_generic
  626. fi
  627. core_exit.sh