install_config.sh 23 KB

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