install_config.sh 26 KB

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