install_config.sh 22 KB

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