install_config.sh 25 KB

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