install_config.sh 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. #!/bin/bash
  2. # LinuxGSM install_config.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: http://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Creates default server configs.
  7. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. # Checks if server cfg dir exists, creates it if it doesn't.
  9. fn_check_cfgdir() {
  10. changes=""
  11. if [ -n "${clustercfgdir}" ]; then
  12. echo -en "creating config directory [ ${italic}${clustercfgdir}${default} ]"
  13. changes+=$(mkdir -pv "${clustercfgdir}")
  14. if [ "$?" -ne 0 ]; then # shellcheck disable=SC2181
  15. fn_print_fail_eol_nl
  16. fn_script_log_fatal "creating ${servercfgdir} config directory"
  17. core_exit.sh
  18. elif [ "${changes}" != "" ]; then
  19. fn_print_ok_eol_nl
  20. fn_script_log_pass "creating ${servercfgdir} config directory"
  21. else
  22. fn_print_skip_eol_nl
  23. fi
  24. elif [ -n "${networkcfgdir}" ]; then
  25. echo -en "creating config directory [ ${italic}${networkcfgdir}${default} ]"
  26. changes+=$(mkdir -pv "${networkcfgdir}")
  27. if [ "$?" -ne 0 ]; then # shellcheck disable=SC2181
  28. fn_print_fail_eol_nl
  29. fn_script_log_fatal "creating ${servercfgdir} config directory"
  30. core_exit.sh
  31. elif [ "${changes}" != "" ]; then
  32. fn_print_ok_eol_nl
  33. fn_script_log_pass "creating ${servercfgdir} config directory"
  34. else
  35. fn_print_skip_eol_nl
  36. fi
  37. else
  38. echo -en "creating config directory [ ${italic}${servercfgdir}${default} ]"
  39. changes+=$(mkdir -pv "${servercfgdir}")
  40. if [ "$?" -ne 0 ]; then # shellcheck disable=SC2181
  41. fn_print_fail_eol_nl
  42. fn_script_log_fatal "creating ${servercfgdir} config directory"
  43. core_exit.sh
  44. elif [ "${changes}" != "" ]; then
  45. fn_print_ok_eol_nl
  46. fn_script_log_pass "creating ${servercfgdir} config directory"
  47. else
  48. fn_print_skip_eol_nl
  49. fi
  50. fi
  51. unset changes
  52. }
  53. # Copys default configs from Game-Server-Configs repo to server config location.
  54. # Downloads default configs from Game-Server-Configs repo to lgsm/config-default.
  55. fn_default_config_remote() {
  56. echo -e ""
  57. echo -e "${bold}${lightyellow}Downloading ${gamename} Configs${default}"
  58. echo -e "${bold}=================================${default}"
  59. echo -e "Default configs are downloaded from:"
  60. echo -e ""
  61. echo -e "${italic}https://github.com/GameServerManagers/Game-Server-Configs${default}"
  62. echo -e ""
  63. fn_sleep_time
  64. githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main"
  65. for config in "${array_configs[@]}"; do
  66. if [ ! -f "${lgsmdir}/config-default/config-game/${config}" ]; then
  67. fn_fetch_file "${githuburl}/${shortname}/${config}" "${remote_fileurl_backup}" "GitHub" "Bitbucket" "${lgsmdir}/config-default/config-game" "${config}" "nochmodx" "norun" "forcedl" "nohash"
  68. fi
  69. fn_check_cfgdir
  70. changes=""
  71. if [ "${config}" == "${servercfgdefault}" ]; then
  72. echo -en "copying config file [ ${italic}${servercfgfullpath}${default} ]"
  73. changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}")
  74. elif [ "${shortname}" == "arma3" ] && [ "${config}" == "${networkcfgdefault}" ]; then
  75. echo -en "copying config file [ ${italic}${networkcfgfullpath}${default} ]"
  76. changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}")
  77. elif [ "${shortname}" == "dst" ] && [ "${config}" == "${clustercfgdefault}" ]; then
  78. echo -en "copying config file [ ${italic}${clustercfgdefault}${default} ]"
  79. changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}")
  80. else
  81. echo -en "copying config file [ ${italic}${servercfgdir}/${config}${default} ]"
  82. changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}")
  83. fi
  84. if [ "$?" -ne 0 ]; then # shellcheck disable=SC2181
  85. fn_print_fail_eol_nl
  86. fn_script_log_fatal "copying config file ${servercfgfullpath}"
  87. elif [ "${changes}" != "" ]; then
  88. fn_print_ok_eol_nl
  89. fn_script_log_pass "copying config file ${servercfgfullpath}"
  90. else
  91. fn_print_skip_eol_nl
  92. fi
  93. unset changes
  94. done
  95. }
  96. # Copys local default config to server config location.
  97. fn_default_config_local() {
  98. fn_check_cfgdir
  99. echo -en "copying config file [ ${italic}${servercfgdefault}${default} ]"
  100. cp -n "${servercfgdir}/${servercfgdefault}" "${servercfgfullpath}"
  101. if [ "${exitcode}" != 0 ]; then
  102. fn_print_fail_eol
  103. fn_script_log_fatal "copying config file [ ${servercfgdefault} ]"
  104. else
  105. fn_print_ok_eol
  106. fn_script_log_pass "copying config file [ ${servercfgdefault} ]"
  107. fi
  108. }
  109. # Changes some variables within the default configs.
  110. # SERVERNAME to LinuxGSM
  111. # PASSWORD to random password
  112. fn_set_config_vars() {
  113. if [ -f "${servercfgfullpath}" ]; then
  114. servername="LinuxGSM"
  115. echo -en "changing server name"
  116. changes=""
  117. # prevents the variable SERVERNAME from being overwritten with the $servername.
  118. if grep -q "SERVERNAME=SERVERNAME" "${lgsmdir}/config-default/config-game/${config}" 2> /dev/null; then
  119. changes+=$(sed -i "s/SERVERNAME=SERVERNAME/SERVERNAME=${servername}/g w /dev/stdout" "${servercfgfullpath}")
  120. elif grep -q "SERVERNAME=\"SERVERNAME\"" "${lgsmdir}/config-default/config-game/${config}" 2> /dev/null; then
  121. changes+=$(sed -i "s/SERVERNAME=\"SERVERNAME\"/SERVERNAME=\"${servername}\"/g w /dev/stdout" "${servercfgfullpath}")
  122. else
  123. changes+=$(sed -i "s/SERVERNAME/${servername}/g w /dev/stdout" "${servercfgfullpath}")
  124. fi
  125. if [ "$?" -ne 0 ]; then # shellcheck disable=SC2181
  126. fn_print_fail_eol
  127. fn_script_log_fatal "changing server name"
  128. elif [ "${changes}" != "" ]; then
  129. fn_print_ok_eol_nl
  130. fn_script_log_pass "changing server name"
  131. else
  132. fn_print_skip_eol_nl
  133. fi
  134. unset changes
  135. randomstring=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs)
  136. adminpass="admin${randomstring}"
  137. echo -en "generating rcon/admin password"
  138. changes=""
  139. if [ "${shortname}" == "squad" ]; then
  140. changes+=$(sed -i "s/ADMINPASSWORD/${adminpass}/g w /dev/stdout" "${servercfgdir}/Rcon.cfg")
  141. else
  142. changes+=$(sed -i "s/ADMINPASSWORD/${adminpass}/g w /dev/stdout" "${servercfgfullpath}")
  143. fi
  144. if [ "$?" -ne 0 ]; then # shellcheck disable=SC2181
  145. fn_print_fail_eol
  146. fn_script_log_fatal "generating rcon/admin password"
  147. elif [ "${changes}" != "" ]; then
  148. fn_print_ok_eol_nl
  149. fn_script_log_pass "generating rcon/admin password"
  150. else
  151. fn_print_skip_eol_nl
  152. fi
  153. unset changes
  154. fi
  155. }
  156. # Changes some variables within the default Don't Starve Together configs.
  157. fn_set_dst_config_vars() {
  158. servername="LinuxGSM"
  159. echo -en "changing cluster name"
  160. changes=""
  161. changes+=$(sed -i "s/SERVERNAME/${servername}/g w /dev/stdout" "${clustercfgfullpath}")
  162. if [ "$?" -ne 0 ]; then # shellcheck disable=SC2181
  163. fn_print_fail_eol
  164. fn_script_log_fatal "changing cluster name"
  165. elif [ "${changes}" != "" ]; then
  166. fn_print_ok_eol_nl
  167. fn_script_log_pass "changing cluster name"
  168. else
  169. fn_print_skip_eol_nl
  170. fi
  171. unset changes
  172. randomstring=$(tr -dc A-Za-z0-9 < /dev/urandom 2> /dev/null | head -c 16 | xargs)
  173. echo -en "generating cluster key"
  174. changes=""
  175. changes+=$(sed -i "s/CLUSTERKEY/${randomstring}/g w /dev/stdout" "${clustercfgfullpath}")
  176. if [ "$?" -ne 0 ]; then # shellcheck disable=SC2181
  177. fn_print_fail_eol
  178. fn_script_log_fatal "generating cluster key"
  179. elif [ "${changes}" != "" ]; then
  180. fn_print_ok_eol_nl
  181. fn_script_log_pass "generating cluster key"
  182. else
  183. fn_print_skip_eol_nl
  184. fi
  185. unset changes
  186. }
  187. # Lists local config locations
  188. fn_list_config_locations() {
  189. echo -e ""
  190. echo -e "${bold}${lightyellow}Config Locations${default}"
  191. echo -e "${bold}=================================${default}"
  192. if [ -n "${servercfgfullpath}" ]; then
  193. if [ -f "${servercfgfullpath}" ]; then
  194. echo -e "${gamename} config file: ${italic}${servercfgfullpath}${default}"
  195. elif [ -d "${servercfgfullpath}" ]; then
  196. echo -e "${gamename} config directory: ${italic}${servercfgfullpath}"
  197. else
  198. echo -e "${gamename} config: ${italic}${red}${servercfgfullpath}${default} (${red}CONFIG IS MISSING${default})"
  199. fi
  200. fi
  201. echo -e "LinuxGSM config: ${italic}${lgsmdir}/config-lgsm/${gameservername}${default}"
  202. echo -e "Config documentation: ${italic}https://docs.linuxgsm.com/configuration${default}"
  203. }
  204. if [ "${shortname}" == "sdtd" ]; then
  205. fn_default_config_local
  206. fn_list_config_locations
  207. elif [ "${shortname}" == "ac" ]; then
  208. array_configs+=(server_cfg.ini)
  209. fn_default_config_remote
  210. fn_set_config_vars
  211. fn_list_config_locations
  212. elif [ "${shortname}" == "ahl" ]; then
  213. array_configs+=(server.cfg)
  214. fn_default_config_remote
  215. fn_set_config_vars
  216. fn_list_config_locations
  217. elif [ "${shortname}" == "ahl2" ]; then
  218. array_configs+=(server.cfg)
  219. fn_default_config_remote
  220. fn_set_config_vars
  221. fn_list_config_locations
  222. elif [ "${shortname}" == "ark" ]; then
  223. array_configs+=(GameUserSettings.ini)
  224. fn_default_config_remote
  225. fn_set_config_vars
  226. fn_list_config_locations
  227. elif [ "${shortname}" == "arma3" ]; then
  228. array_configs+=(server.cfg network.cfg)
  229. fn_default_config_remote
  230. fn_set_config_vars
  231. fn_list_config_locations
  232. elif [ "${shortname}" == "armar" ]; then
  233. array_configs+=(server.json)
  234. fn_default_config_remote
  235. fn_set_config_vars
  236. fn_list_config_locations
  237. elif [ "${shortname}" == "ats" ]; then
  238. array_configs+=(server_config.sii)
  239. fn_default_config_remote
  240. fn_set_config_vars
  241. fn_list_config_locations
  242. elif [ "${shortname}" == "bo" ]; then
  243. array_configs+=(config.txt)
  244. fn_default_config_remote
  245. fn_set_config_vars
  246. fn_list_config_locations
  247. elif [ "${shortname}" == "bd" ]; then
  248. array_configs+=(server.cfg)
  249. fn_default_config_remote
  250. fn_set_config_vars
  251. fn_list_config_locations
  252. elif [ "${shortname}" == "bt" ]; then
  253. array_configs+=(serversettings.xml)
  254. fn_default_config_remote
  255. fn_set_config_vars
  256. fn_list_config_locations
  257. elif [ "${shortname}" == "btl" ]; then
  258. array_configs+=(DefaultGame.ini)
  259. fn_default_config_remote
  260. fn_set_config_vars
  261. fn_list_config_locations
  262. elif [ "${shortname}" == "bf1942" ]; then
  263. array_configs+=(serversettings.con)
  264. fn_default_config_remote
  265. fn_set_config_vars
  266. fn_list_config_locations
  267. elif [ "${shortname}" == "bfv" ]; then
  268. array_configs+=(serversettings.con)
  269. fn_default_config_remote
  270. fn_set_config_vars
  271. fn_list_config_locations
  272. elif [ "${shortname}" == "bs" ]; then
  273. array_configs+=(server.cfg)
  274. fn_default_config_remote
  275. fn_set_config_vars
  276. fn_list_config_locations
  277. elif [ "${shortname}" == "bb" ]; then
  278. array_configs+=(server.cfg)
  279. fn_default_config_remote
  280. fn_set_config_vars
  281. fn_list_config_locations
  282. elif [ "${shortname}" == "bb2" ]; then
  283. array_configs+=(server.cfg)
  284. fn_default_config_remote
  285. fn_set_config_vars
  286. fn_list_config_locations
  287. elif [ "${shortname}" == "bmdm" ]; then
  288. array_configs+=(server.cfg)
  289. fn_default_config_remote
  290. fn_set_config_vars
  291. fn_list_config_locations
  292. elif [ "${shortname}" == "cd" ]; then
  293. array_configs+=(properties.json)
  294. fn_default_config_remote
  295. fn_set_config_vars
  296. fn_list_config_locations
  297. elif [ "${shortname}" == "ck" ]; then
  298. array_configs+=(ServerConfig.json)
  299. fn_default_config_remote
  300. fn_set_config_vars
  301. fn_list_config_locations
  302. elif [ "${shortname}" == "cod" ]; then
  303. array_configs+=(server.cfg)
  304. fn_default_config_remote
  305. fn_set_config_vars
  306. fn_list_config_locations
  307. elif [ "${shortname}" == "coduo" ]; then
  308. array_configs+=(server.cfg)
  309. fn_default_config_remote
  310. fn_set_config_vars
  311. fn_list_config_locations
  312. elif [ "${shortname}" == "cod2" ]; then
  313. array_configs+=(server.cfg)
  314. fn_default_config_remote
  315. fn_set_config_vars
  316. fn_list_config_locations
  317. elif [ "${shortname}" == "cod4" ]; then
  318. array_configs+=(server.cfg)
  319. fn_default_config_remote
  320. fn_set_config_vars
  321. fn_list_config_locations
  322. elif [ "${shortname}" == "codwaw" ]; then
  323. array_configs+=(server.cfg)
  324. fn_default_config_remote
  325. fn_set_config_vars
  326. fn_list_config_locations
  327. elif [ "${shortname}" == "cc" ]; then
  328. array_configs+=(server.cfg)
  329. fn_default_config_remote
  330. fn_set_config_vars
  331. fn_list_config_locations
  332. elif [ "${shortname}" == "col" ]; then
  333. array_configs+=(colserver.json)
  334. fn_default_config_remote
  335. fn_set_config_vars
  336. fn_list_config_locations
  337. elif [ "${shortname}" == "cs" ]; then
  338. array_configs+=(server.cfg)
  339. fn_default_config_remote
  340. fn_set_config_vars
  341. fn_list_config_locations
  342. elif [ "${shortname}" == "cscz" ]; then
  343. array_configs+=(server.cfg)
  344. fn_default_config_remote
  345. fn_set_config_vars
  346. fn_list_config_locations
  347. elif [ "${shortname}" == "csgo" ]; then
  348. array_configs+=(server.cfg)
  349. fn_default_config_remote
  350. fn_set_config_vars
  351. fn_list_config_locations
  352. elif [ "${shortname}" == "css" ]; then
  353. array_configs+=(server.cfg)
  354. fn_default_config_remote
  355. fn_set_config_vars
  356. fn_list_config_locations
  357. elif [ "${shortname}" == "ct" ]; then
  358. array_configs+=(ServerSetting.ini)
  359. fn_default_config_remote
  360. fn_set_config_vars
  361. fn_list_config_locations
  362. elif [ "${shortname}" == "dayz" ]; then
  363. array_configs+=(server.cfg)
  364. fn_default_config_remote
  365. fn_set_config_vars
  366. fn_list_config_locations
  367. elif [ "${shortname}" == "dod" ]; then
  368. array_configs+=(server.cfg)
  369. fn_default_config_remote
  370. fn_set_config_vars
  371. fn_list_config_locations
  372. elif [ "${shortname}" == "dodr" ]; then
  373. array_configs+=(Game.ini)
  374. fn_default_config_remote
  375. fn_list_config_locations
  376. elif [ "${shortname}" == "dods" ]; then
  377. array_configs+=(server.cfg)
  378. fn_default_config_remote
  379. fn_set_config_vars
  380. fn_list_config_locations
  381. elif [ "${shortname}" == "doi" ]; then
  382. array_configs+=(server.cfg)
  383. fn_default_config_remote
  384. fn_set_config_vars
  385. fn_list_config_locations
  386. elif [ "${shortname}" == "dmc" ]; then
  387. array_configs+=(server.cfg)
  388. fn_default_config_remote
  389. fn_set_config_vars
  390. fn_list_config_locations
  391. elif [ "${shortname}" == "dst" ]; then
  392. array_configs+=(cluster.ini server.ini)
  393. fn_default_config_remote
  394. fn_set_dst_config_vars
  395. fn_list_config_locations
  396. elif [ "${shortname}" == "dab" ]; then
  397. array_configs+=(server.cfg)
  398. fn_default_config_remote
  399. fn_set_config_vars
  400. fn_list_config_locations
  401. elif [ "${shortname}" == "dys" ]; then
  402. array_configs+=(server.cfg)
  403. fn_default_config_remote
  404. fn_set_config_vars
  405. fn_list_config_locations
  406. elif [ "${shortname}" == "eco" ]; then
  407. array_configs+=(Network.eco)
  408. fn_default_config_remote
  409. fn_set_config_vars
  410. fn_list_config_locations
  411. elif [ "${shortname}" == "em" ]; then
  412. fn_default_config_local
  413. fn_list_config_locations
  414. elif [ "${shortname}" == "etl" ]; then
  415. array_configs+=(server.cfg)
  416. fn_default_config_remote
  417. fn_set_config_vars
  418. fn_list_config_locations
  419. elif [ "${shortname}" == "ets2" ]; then
  420. array_configs+=(server_config.sii)
  421. fn_default_config_remote
  422. fn_set_config_vars
  423. fn_list_config_locations
  424. elif [ "${shortname}" == "fctr" ]; then
  425. array_configs+=(server-settings.json)
  426. fn_default_config_remote
  427. fn_set_config_vars
  428. fn_list_config_locations
  429. elif [ "${shortname}" == "fof" ]; then
  430. array_configs+=(server.cfg)
  431. fn_default_config_remote
  432. fn_set_config_vars
  433. fn_list_config_locations
  434. elif [ "${shortname}" == "gmod" ]; then
  435. array_configs+=(server.cfg)
  436. fn_default_config_remote
  437. fn_set_config_vars
  438. fn_list_config_locations
  439. elif [ "${shortname}" == "hldm" ]; then
  440. array_configs+=(server.cfg)
  441. fn_default_config_remote
  442. fn_set_config_vars
  443. fn_list_config_locations
  444. elif [ "${shortname}" == "hldms" ]; then
  445. array_configs+=(server.cfg)
  446. fn_default_config_remote
  447. fn_set_config_vars
  448. fn_list_config_locations
  449. elif [ "${shortname}" == "ohd" ]; then
  450. array_configs+=(Game.ini)
  451. fn_default_config_remote
  452. fn_set_config_vars
  453. fn_list_config_locations
  454. elif [ "${shortname}" == "opfor" ]; then
  455. array_configs+=(server.cfg)
  456. fn_default_config_remote
  457. fn_set_config_vars
  458. fn_list_config_locations
  459. elif [ "${shortname}" == "hl2dm" ]; then
  460. array_configs+=(server.cfg)
  461. fn_default_config_remote
  462. fn_set_config_vars
  463. fn_list_config_locations
  464. elif [ "${shortname}" == "ins" ]; then
  465. array_configs+=(server.cfg)
  466. fn_default_config_remote
  467. fn_set_config_vars
  468. fn_list_config_locations
  469. elif [ "${shortname}" == "ios" ]; then
  470. array_configs+=(server.cfg)
  471. fn_default_config_remote
  472. fn_set_config_vars
  473. fn_list_config_locations
  474. elif [ "${shortname}" == "jc2" ]; then
  475. array_configs+=(config.lua)
  476. fn_default_config_remote
  477. fn_set_config_vars
  478. fn_list_config_locations
  479. elif [ "${shortname}" == "jc3" ]; then
  480. array_configs+=(config.json)
  481. fn_default_config_remote
  482. fn_set_config_vars
  483. fn_list_config_locations
  484. elif [ "${shortname}" == "kf" ]; then
  485. array_configs+=(Default.ini)
  486. fn_default_config_remote
  487. fn_set_config_vars
  488. fn_list_config_locations
  489. elif [ "${shortname}" == "l4d" ]; then
  490. array_configs+=(server.cfg)
  491. fn_default_config_remote
  492. fn_set_config_vars
  493. fn_list_config_locations
  494. elif [ "${shortname}" == "l4d2" ]; then
  495. array_configs+=(server.cfg)
  496. fn_default_config_remote
  497. fn_set_config_vars
  498. fn_list_config_locations
  499. elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then
  500. array_configs+=(server.properties)
  501. fn_default_config_remote
  502. fn_set_config_vars
  503. fn_list_config_locations
  504. elif [ "${shortname}" == "mcb" ]; then
  505. array_configs+=(server.properties)
  506. fn_default_config_remote
  507. fn_set_config_vars
  508. fn_list_config_locations
  509. elif [ "${shortname}" == "mohaa" ]; then
  510. array_configs+=(server.cfg)
  511. fn_default_config_remote
  512. fn_set_config_vars
  513. fn_list_config_locations
  514. elif [ "${shortname}" == "mh" ]; then
  515. array_configs+=(Game.ini)
  516. fn_default_config_remote
  517. fn_set_config_vars
  518. fn_list_config_locations
  519. elif [ "${shortname}" == "ns" ]; then
  520. array_configs+=(server.cfg)
  521. fn_default_config_remote
  522. fn_set_config_vars
  523. fn_list_config_locations
  524. elif [ "${shortname}" == "nmrih" ]; then
  525. array_configs+=(server.cfg)
  526. fn_default_config_remote
  527. fn_set_config_vars
  528. fn_list_config_locations
  529. elif [ "${shortname}" == "nd" ]; then
  530. array_configs+=(server.cfg)
  531. fn_default_config_remote
  532. fn_set_config_vars
  533. fn_list_config_locations
  534. elif [ "${shortname}" == "mta" ]; then
  535. array_configs+=(acl.xml mtaserver.conf vehiclecolors.conf)
  536. fn_default_config_remote
  537. fn_list_config_locations
  538. elif [ "${shotname}" == "mom" ]; then
  539. array_configs+=(DedicatedServerConfig.cfg)
  540. fn_default_config_remote
  541. fn_set_config_vars
  542. fn_list_config_locations
  543. elif [ "${shortname}" == "pvr" ]; then
  544. array_configs+=(Game.ini)
  545. fn_default_config_remote
  546. fn_set_config_vars
  547. elif [ "${shortname}" == "pvkii" ]; then
  548. array_configs+=(server.cfg)
  549. fn_default_config_remote
  550. fn_set_config_vars
  551. fn_list_config_locations
  552. elif [ "${shortname}" == "pz" ]; then
  553. array_configs+=(server.ini)
  554. fn_default_config_remote
  555. fn_set_config_vars
  556. fn_list_config_locations
  557. elif [ "${shortname}" == "nec" ]; then
  558. array_configs+=(server.cfg)
  559. fn_default_config_remote
  560. fn_set_config_vars
  561. fn_list_config_locations
  562. elif [ "${shortname}" == "pc" ]; then
  563. array_configs+=(server.cfg)
  564. fn_default_config_remote
  565. fn_set_config_vars
  566. fn_list_config_locations
  567. elif [ "${shortname}" == "pc2" ]; then
  568. fn_default_config_local
  569. fn_list_config_locations
  570. elif [ "${shortname}" == "q2" ]; then
  571. array_configs+=(server.cfg)
  572. fn_default_config_remote
  573. fn_set_config_vars
  574. fn_list_config_locations
  575. elif [ "${shortname}" == "q3" ]; then
  576. array_configs+=(server.cfg)
  577. fn_default_config_remote
  578. fn_set_config_vars
  579. fn_list_config_locations
  580. elif [ "${shortname}" == "ql" ]; then
  581. array_configs+=(server.cfg)
  582. fn_default_config_remote
  583. fn_set_config_vars
  584. fn_list_config_locations
  585. elif [ "${shortname}" == "jk2" ]; then
  586. array_configs+=(server.cfg)
  587. fn_default_config_remote
  588. fn_set_config_vars
  589. elif [ "${shortname}" == "qw" ]; then
  590. array_configs+=(server.cfg)
  591. fn_default_config_remote
  592. fn_set_config_vars
  593. fn_list_config_locations
  594. elif [ "${shortname}" == "ricochet" ]; then
  595. array_configs+=(server.cfg)
  596. fn_default_config_remote
  597. fn_set_config_vars
  598. fn_list_config_locations
  599. elif [ "${shortname}" == "rtcw" ]; then
  600. array_configs+=(server.cfg)
  601. fn_default_config_remote
  602. fn_set_config_vars
  603. fn_list_config_locations
  604. elif [ "${shortname}" == "rust" ]; then
  605. array_configs+=(server.cfg)
  606. fn_default_config_remote
  607. fn_list_config_locations
  608. elif [ "${shortname}" == "scpsl" ] || [ "${shortname}" == "scpslsm" ]; then
  609. array_configs+=(config_gameplay.txt config_localadmin.txt)
  610. fn_default_config_remote
  611. fn_set_config_vars
  612. fn_list_config_locations
  613. elif [ "${shortname}" == "sf" ]; then
  614. array_configs+=(GameUserSettings.ini)
  615. fn_default_config_remote
  616. fn_set_config_vars
  617. fn_list_config_locations
  618. elif [ "${shortname}" == "sol" ]; then
  619. array_configs+=(soldat.ini)
  620. fn_default_config_remote
  621. fn_set_config_vars
  622. fn_list_config_locations
  623. elif [ "${shortname}" == "sof2" ]; then
  624. array_configs+=(server.cfg mapcycle.txt)
  625. fn_default_config_remote
  626. fn_set_config_vars
  627. fn_list_config_locations
  628. elif [ "${shortname}" == "sfc" ]; then
  629. array_configs+=(server.cfg)
  630. fn_default_config_remote
  631. fn_set_config_vars
  632. fn_list_config_locations
  633. elif [ "${shortname}" == "squad" ]; then
  634. array_configs+=(Admins.cfg Bans.cfg License.cfg Server.cfg Rcon.cfg)
  635. fn_default_config_remote
  636. fn_set_config_vars
  637. fn_list_config_locations
  638. elif [ "${shortname}" == "sb" ]; then
  639. array_configs+=(starbound_server.config)
  640. fn_default_config_remote
  641. fn_set_config_vars
  642. fn_list_config_locations
  643. elif [ "${shortname}" == "stn" ]; then
  644. array_configs+=(ServerConfig.txt ServerUsers.txt TpPresets.json UserPermissions.json)
  645. fn_default_config_remote
  646. fn_set_config_vars
  647. fn_list_config_locations
  648. elif [ "${shortname}" == "sven" ]; then
  649. array_configs+=(server.cfg)
  650. fn_default_config_remote
  651. fn_set_config_vars
  652. fn_list_config_locations
  653. elif [ "${shortname}" == "tf2" ]; then
  654. array_configs+=(server.cfg)
  655. fn_default_config_remote
  656. fn_set_config_vars
  657. fn_list_config_locations
  658. elif [ "${shortname}" == "tfc" ]; then
  659. array_configs+=(server.cfg)
  660. fn_default_config_remote
  661. fn_set_config_vars
  662. fn_list_config_locations
  663. elif [ "${shortname}" == "ti" ]; then
  664. array_configs+=(Game.ini Engine.ini)
  665. fn_default_config_remote
  666. fn_set_config_vars
  667. fn_list_config_locations
  668. elif [ "${shortname}" == "ts" ]; then
  669. array_configs+=(server.cfg)
  670. fn_default_config_remote
  671. fn_set_config_vars
  672. fn_list_config_locations
  673. elif [ "${shortname}" == "ts3" ]; then
  674. array_configs+=(ts3server.ini)
  675. fn_default_config_remote
  676. fn_list_config_locations
  677. elif [ "${shortname}" == "tw" ]; then
  678. array_configs+=(server.cfg ctf.cfg dm.cfg duel.cfg tdm.cfg)
  679. fn_default_config_remote
  680. fn_set_config_vars
  681. fn_list_config_locations
  682. elif [ "${shortname}" == "terraria" ]; then
  683. array_configs+=(serverconfig.txt)
  684. fn_default_config_remote
  685. fn_set_config_vars
  686. fn_list_config_locations
  687. elif [ "${shortname}" == "tu" ]; then
  688. array_configs+=(TowerServer.ini)
  689. fn_default_config_remote
  690. fn_set_config_vars
  691. fn_list_config_locations
  692. elif [ "${shortname}" == "ut" ]; then
  693. array_configs+=(Game.ini Engine.ini)
  694. fn_default_config_remote
  695. fn_set_config_vars
  696. fn_list_config_locations
  697. elif [ "${shortname}" == "ut2k4" ]; then
  698. array_configs+=(UT2004.ini)
  699. fn_default_config_remote
  700. fn_set_config_vars
  701. fn_list_config_locations
  702. elif [ "${shortname}" == "ut99" ]; then
  703. array_configs+=(Default.ini)
  704. fn_default_config_remote
  705. fn_set_config_vars
  706. fn_list_config_locations
  707. elif [ "${shortname}" == "unt" ]; then
  708. # Config is generated on first run
  709. :
  710. elif [ "${shortname}" == "vints" ]; then
  711. # Config is generated on first run
  712. :
  713. elif [ "${shortname}" == "vs" ]; then
  714. array_configs+=(server.cfg)
  715. fn_default_config_remote
  716. fn_set_config_vars
  717. fn_list_config_locations
  718. elif [ "${shortname}" == "wet" ]; then
  719. array_configs+=(server.cfg)
  720. fn_default_config_remote
  721. fn_set_config_vars
  722. fn_list_config_locations
  723. elif [ "${shortname}" == "wf" ]; then
  724. array_configs+=(server.cfg)
  725. fn_default_config_remote
  726. fn_set_config_vars
  727. fn_list_config_locations
  728. elif [ "${shortname}" == "wmc" ]; then
  729. array_configs+=(config.yml)
  730. fn_default_config_remote
  731. fn_set_config_vars
  732. elif [ "${shortname}" == "wurm" ]; then
  733. array_configs+=(server.cfg)
  734. fn_default_config_remote
  735. fn_set_config_vars
  736. fn_list_config_locations
  737. elif [ "${shortname}" == "zmr" ]; then
  738. array_configs+=(server.cfg)
  739. fn_default_config_remote
  740. fn_set_config_vars
  741. fn_list_config_locations
  742. elif [ "${shortname}" == "zps" ]; then
  743. array_configs+=(server.cfg)
  744. fn_default_config_remote
  745. fn_set_config_vars
  746. fn_list_config_locations
  747. fi