install_config.sh 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  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. rconpass="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. fn_print_skip_eol_nl
  176. fi
  177. unset changes
  178. randomstring=$(tr -dc A-Za-z0-9 < /dev/urandom 2> /dev/null | head -c 16 | xargs)
  179. echo -en "generating cluster key"
  180. changes=""
  181. changes+=$(sed -i "s/CLUSTERKEY/${randomstring}/g w /dev/stdout" "${clustercfgfullpath}")
  182. exitcode=$?
  183. if [ "${exitcode}" -ne 0 ]; then
  184. fn_print_fail_eol
  185. fn_script_log_fail "generating cluster key"
  186. elif [ "${changes}" != "" ]; then
  187. fn_print_ok_eol_nl
  188. fn_script_log_pass "generating cluster key"
  189. else
  190. fn_print_skip_eol_nl
  191. fi
  192. echo -e "changing shard name."
  193. fn_script_log_info "Changing shard name."
  194. sed -i "s/SHARDNAME/${shard}/g" "${servercfgfullpath}"
  195. fn_sleep_time
  196. echo -e "changing master setting."
  197. fn_script_log_info "Changing master setting."
  198. sed -i "s/ISMASTER/${master}/g" "${servercfgfullpath}"
  199. fn_sleep_time
  200. ## worldgenoverride.lua
  201. if [ "${cave}" == "true" ]; then
  202. echo -e "defining ${shard} as cave in ${servercfgdir}/worldgenoverride.lua."
  203. fn_script_log_info "Defining ${shard} as cave in ${servercfgdir}/worldgenoverride.lua."
  204. echo 'return { override_enabled = true, preset = "DST_CAVE", }' > "${servercfgdir}/worldgenoverride.lua"
  205. fi
  206. fn_sleep_time
  207. echo -e ""
  208. }
  209. # Lists local config locations
  210. fn_list_config_locations() {
  211. echo -e ""
  212. echo -e "${bold}${lightyellow}Config Locations${default}"
  213. fn_messages_separator
  214. if [ -n "${servercfgfullpath}" ]; then
  215. if [ -f "${servercfgfullpath}" ]; then
  216. echo -e "${gamename} config file: ${italic}${servercfgfullpath}${default}"
  217. elif [ -d "${servercfgfullpath}" ]; then
  218. echo -e "${gamename} config directory: ${italic}${servercfgfullpath}"
  219. else
  220. echo -e "${gamename} config: ${italic}${red}${servercfgfullpath}${default} (${red}CONFIG IS MISSING${default})"
  221. fi
  222. fi
  223. echo -e "LinuxGSM config: ${italic}${lgsmdir}/config-lgsm/${gameservername}${default}"
  224. echo -e "Config documentation: ${italic}https://docs.linuxgsm.com/configuration${default}"
  225. }
  226. if [ "${shortname}" == "sdtd" ]; then
  227. fn_default_config_local
  228. fn_list_config_locations
  229. elif [ "${shortname}" == "ac" ]; then
  230. array_configs+=(server_cfg.ini)
  231. fn_default_config_remote
  232. fn_set_config_vars
  233. fn_list_config_locations
  234. elif [ "${shortname}" == "ahl" ]; then
  235. array_configs+=(server.cfg)
  236. fn_default_config_remote
  237. fn_set_config_vars
  238. fn_list_config_locations
  239. elif [ "${shortname}" == "ahl2" ]; then
  240. array_configs+=(server.cfg)
  241. fn_default_config_remote
  242. fn_set_config_vars
  243. fn_list_config_locations
  244. elif [ "${shortname}" == "ark" ]; then
  245. array_configs+=(GameUserSettings.ini)
  246. fn_default_config_remote
  247. fn_set_config_vars
  248. fn_list_config_locations
  249. elif [ "${shortname}" == "arma3" ]; then
  250. array_configs+=(server.cfg network.cfg)
  251. fn_default_config_remote
  252. fn_set_config_vars
  253. fn_list_config_locations
  254. elif [ "${shortname}" == "armar" ]; then
  255. array_configs+=(server.json)
  256. fn_default_config_remote
  257. fn_set_config_vars
  258. fn_list_config_locations
  259. elif [ "${shortname}" == "ats" ]; then
  260. array_configs+=(server_config.sii)
  261. fn_default_config_remote
  262. fn_set_config_vars
  263. fn_list_config_locations
  264. elif [ "${shortname}" == "bo" ]; then
  265. array_configs+=(config.txt)
  266. fn_default_config_remote
  267. fn_set_config_vars
  268. fn_list_config_locations
  269. elif [ "${shortname}" == "bd" ]; then
  270. array_configs+=(server.cfg)
  271. fn_default_config_remote
  272. fn_set_config_vars
  273. fn_list_config_locations
  274. elif [ "${shortname}" == "bt" ]; then
  275. array_configs+=(serversettings.xml)
  276. fn_default_config_remote
  277. fn_set_config_vars
  278. fn_list_config_locations
  279. elif [ "${shortname}" == "btl" ]; then
  280. fn_check_cfgdir
  281. array_configs+=(Game.ini)
  282. fn_fetch_default_config
  283. fn_default_config_remote
  284. fn_set_config_vars
  285. fn_list_config_locations
  286. elif [ "${shortname}" == "bf1942" ]; then
  287. array_configs+=(serversettings.con)
  288. fn_default_config_remote
  289. fn_set_config_vars
  290. fn_list_config_locations
  291. elif [ "${shortname}" == "bfv" ]; then
  292. array_configs+=(serversettings.con)
  293. fn_default_config_remote
  294. fn_set_config_vars
  295. fn_list_config_locations
  296. elif [ "${shortname}" == "bs" ]; then
  297. array_configs+=(server.cfg)
  298. fn_default_config_remote
  299. fn_set_config_vars
  300. fn_list_config_locations
  301. elif [ "${shortname}" == "bb" ]; then
  302. array_configs+=(server.cfg)
  303. fn_default_config_remote
  304. fn_set_config_vars
  305. fn_list_config_locations
  306. elif [ "${shortname}" == "bb2" ]; then
  307. array_configs+=(server.cfg)
  308. fn_default_config_remote
  309. fn_set_config_vars
  310. fn_list_config_locations
  311. elif [ "${shortname}" == "bmdm" ]; then
  312. array_configs+=(server.cfg)
  313. fn_default_config_remote
  314. fn_set_config_vars
  315. fn_list_config_locations
  316. elif [ "${shortname}" == "ck" ]; then
  317. array_configs+=(ServerConfig.json)
  318. fn_default_config_remote
  319. fn_set_config_vars
  320. fn_list_config_locations
  321. elif [ "${shortname}" == "cod" ]; then
  322. array_configs+=(server.cfg)
  323. fn_default_config_remote
  324. fn_set_config_vars
  325. fn_list_config_locations
  326. elif [ "${shortname}" == "coduo" ]; then
  327. array_configs+=(server.cfg)
  328. fn_default_config_remote
  329. fn_set_config_vars
  330. fn_list_config_locations
  331. elif [ "${shortname}" == "cod2" ]; then
  332. array_configs+=(server.cfg)
  333. fn_default_config_remote
  334. fn_set_config_vars
  335. fn_list_config_locations
  336. elif [ "${shortname}" == "cod4" ]; then
  337. array_configs+=(server.cfg)
  338. fn_default_config_remote
  339. fn_set_config_vars
  340. fn_list_config_locations
  341. elif [ "${shortname}" == "codwaw" ]; then
  342. array_configs+=(server.cfg)
  343. fn_default_config_remote
  344. fn_set_config_vars
  345. fn_list_config_locations
  346. elif [ "${shortname}" == "cc" ]; then
  347. array_configs+=(server.cfg)
  348. fn_default_config_remote
  349. fn_set_config_vars
  350. fn_list_config_locations
  351. elif [ "${shortname}" == "col" ]; then
  352. array_configs+=(colserver.json)
  353. fn_default_config_remote
  354. fn_set_config_vars
  355. fn_list_config_locations
  356. elif [ "${shortname}" == "cs" ]; then
  357. array_configs+=(server.cfg)
  358. fn_default_config_remote
  359. fn_set_config_vars
  360. fn_list_config_locations
  361. elif [ "${shortname}" == "cs2" ]; then
  362. array_configs+=(server.cfg)
  363. fn_fetch_default_config
  364. fn_default_config_remote
  365. fn_set_config_vars
  366. fn_list_config_locations
  367. elif [ "${shortname}" == "cscz" ]; then
  368. array_configs+=(server.cfg)
  369. fn_default_config_remote
  370. fn_set_config_vars
  371. fn_list_config_locations
  372. elif [ "${shortname}" == "csgo" ]; then
  373. array_configs+=(server.cfg)
  374. fn_default_config_remote
  375. fn_set_config_vars
  376. fn_list_config_locations
  377. elif [ "${shortname}" == "css" ]; then
  378. array_configs+=(server.cfg)
  379. fn_default_config_remote
  380. fn_set_config_vars
  381. fn_list_config_locations
  382. elif [ "${shortname}" == "ct" ]; then
  383. array_configs+=(ServerSetting.ini)
  384. fn_default_config_remote
  385. fn_set_config_vars
  386. fn_list_config_locations
  387. elif [ "${shortname}" == "dayz" ]; then
  388. array_configs+=(server.cfg)
  389. fn_default_config_remote
  390. fn_set_config_vars
  391. fn_list_config_locations
  392. elif [ "${shortname}" == "dod" ]; then
  393. array_configs+=(server.cfg)
  394. fn_default_config_remote
  395. fn_set_config_vars
  396. fn_list_config_locations
  397. elif [ "${shortname}" == "dodr" ]; then
  398. array_configs+=(Game.ini)
  399. fn_default_config_remote
  400. fn_list_config_locations
  401. elif [ "${shortname}" == "dods" ]; then
  402. array_configs+=(server.cfg)
  403. fn_default_config_remote
  404. fn_set_config_vars
  405. fn_list_config_locations
  406. elif [ "${shortname}" == "doi" ]; then
  407. array_configs+=(server.cfg)
  408. fn_default_config_remote
  409. fn_set_config_vars
  410. fn_list_config_locations
  411. elif [ "${shortname}" == "dmc" ]; then
  412. array_configs+=(server.cfg)
  413. fn_default_config_remote
  414. fn_set_config_vars
  415. fn_list_config_locations
  416. elif [ "${shortname}" == "dst" ]; then
  417. array_configs+=(cluster.ini server.ini)
  418. fn_default_config_remote
  419. fn_set_dst_config_vars
  420. fn_list_config_locations
  421. elif [ "${shortname}" == "dab" ]; then
  422. array_configs+=(server.cfg)
  423. fn_default_config_remote
  424. fn_set_config_vars
  425. fn_list_config_locations
  426. elif [ "${shortname}" == "dys" ]; then
  427. array_configs+=(server.cfg)
  428. fn_default_config_remote
  429. fn_set_config_vars
  430. fn_list_config_locations
  431. elif [ "${shortname}" == "eco" ]; then
  432. array_configs+=(Network.eco)
  433. fn_default_config_remote
  434. fn_set_config_vars
  435. fn_list_config_locations
  436. elif [ "${shortname}" == "em" ]; then
  437. fn_default_config_local
  438. fn_list_config_locations
  439. elif [ "${shortname}" == "etl" ]; then
  440. array_configs+=(server.cfg)
  441. fn_default_config_remote
  442. fn_set_config_vars
  443. fn_list_config_locations
  444. elif [ "${shortname}" == "ets2" ]; then
  445. array_configs+=(server_config.sii)
  446. fn_default_config_remote
  447. fn_set_config_vars
  448. fn_list_config_locations
  449. elif [ "${shortname}" == "fctr" ]; then
  450. array_configs+=(server-settings.json)
  451. fn_default_config_remote
  452. fn_set_config_vars
  453. fn_list_config_locations
  454. elif [ "${shortname}" == "fof" ]; then
  455. array_configs+=(server.cfg)
  456. fn_default_config_remote
  457. fn_set_config_vars
  458. fn_list_config_locations
  459. elif [ "${shortname}" == "gmod" ]; then
  460. array_configs+=(server.cfg)
  461. fn_default_config_remote
  462. fn_set_config_vars
  463. fn_list_config_locations
  464. elif [ "${shortname}" == "hldm" ]; then
  465. array_configs+=(server.cfg)
  466. fn_default_config_remote
  467. fn_set_config_vars
  468. fn_list_config_locations
  469. elif [ "${shortname}" == "hldms" ]; then
  470. array_configs+=(server.cfg)
  471. fn_default_config_remote
  472. fn_set_config_vars
  473. fn_list_config_locations
  474. elif [ "${shortname}" == "ohd" ]; then
  475. array_configs+=(Admins.cfg Engine.ini Game.ini MapCycle.cfg)
  476. fn_fetch_default_config
  477. fn_default_config_remote
  478. fn_set_config_vars
  479. fn_list_config_locations
  480. elif [ "${shortname}" == "opfor" ]; then
  481. array_configs+=(server.cfg)
  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_default_config_remote
  488. fn_set_config_vars
  489. fn_list_config_locations
  490. elif [ "${shortname}" == "hz" ]; then
  491. # Config is generated on first run
  492. :
  493. elif [ "${shortname}" == "ins" ]; then
  494. array_configs+=(server.cfg)
  495. fn_default_config_remote
  496. fn_set_config_vars
  497. fn_list_config_locations
  498. elif [ "${shortname}" == "ios" ]; then
  499. array_configs+=(server.cfg)
  500. fn_default_config_remote
  501. fn_set_config_vars
  502. fn_list_config_locations
  503. elif [ "${shortname}" == "jc2" ]; then
  504. array_configs+=(config.lua)
  505. fn_default_config_remote
  506. fn_set_config_vars
  507. fn_list_config_locations
  508. elif [ "${shortname}" == "jc3" ]; then
  509. array_configs+=(config.json)
  510. fn_default_config_remote
  511. fn_set_config_vars
  512. fn_list_config_locations
  513. elif [ "${shortname}" == "kf" ]; then
  514. array_configs+=(Default.ini)
  515. fn_default_config_remote
  516. fn_set_config_vars
  517. fn_list_config_locations
  518. elif [ "${shortname}" == "l4d" ]; then
  519. array_configs+=(server.cfg)
  520. fn_default_config_remote
  521. fn_set_config_vars
  522. fn_list_config_locations
  523. elif [ "${shortname}" == "l4d2" ]; then
  524. array_configs+=(server.cfg)
  525. fn_default_config_remote
  526. fn_set_config_vars
  527. fn_list_config_locations
  528. elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then
  529. array_configs+=(server.properties)
  530. fn_default_config_remote
  531. fn_set_config_vars
  532. fn_list_config_locations
  533. elif [ "${shortname}" == "mcb" ]; then
  534. array_configs+=(server.properties)
  535. fn_default_config_remote
  536. fn_set_config_vars
  537. fn_list_config_locations
  538. elif [ "${shortname}" == "mohaa" ]; then
  539. array_configs+=(server.cfg)
  540. fn_default_config_remote
  541. fn_set_config_vars
  542. fn_list_config_locations
  543. elif [ "${shortname}" == "mh" ]; then
  544. array_configs+=(Game.ini)
  545. fn_default_config_remote
  546. fn_set_config_vars
  547. fn_list_config_locations
  548. elif [ "${shortname}" == "ns" ]; then
  549. array_configs+=(server.cfg)
  550. fn_default_config_remote
  551. fn_set_config_vars
  552. fn_list_config_locations
  553. elif [ "${shortname}" == "nmrih" ]; then
  554. array_configs+=(server.cfg)
  555. fn_default_config_remote
  556. fn_set_config_vars
  557. fn_list_config_locations
  558. elif [ "${shortname}" == "nd" ]; then
  559. array_configs+=(server.cfg)
  560. fn_default_config_remote
  561. fn_set_config_vars
  562. fn_list_config_locations
  563. elif [ "${shortname}" == "mta" ]; then
  564. array_configs+=(acl.xml mtaserver.conf vehiclecolors.conf)
  565. fn_default_config_remote
  566. fn_list_config_locations
  567. elif [ "${shortname}" == "pvr" ]; then
  568. array_configs+=(Game.ini)
  569. fn_default_config_remote
  570. fn_set_config_vars
  571. elif [ "${shortname}" == "pvkii" ]; then
  572. array_configs+=(server.cfg)
  573. fn_default_config_remote
  574. fn_set_config_vars
  575. fn_list_config_locations
  576. elif [ "${shortname}" == "pw" ]; then
  577. array_configs+=(PalWorldSettings.ini)
  578. fn_fetch_default_config
  579. fn_default_config_remote
  580. fn_set_config_vars
  581. fn_list_config_locations
  582. elif [ "${shortname}" == "pz" ]; then
  583. array_configs+=(server.ini)
  584. fn_default_config_remote
  585. fn_set_config_vars
  586. fn_list_config_locations
  587. elif [ "${shortname}" == "nec" ]; then
  588. array_configs+=(server.cfg)
  589. fn_default_config_remote
  590. fn_set_config_vars
  591. fn_list_config_locations
  592. elif [ "${shortname}" == "pc" ]; then
  593. array_configs+=(server.cfg)
  594. fn_default_config_remote
  595. fn_set_config_vars
  596. fn_list_config_locations
  597. elif [ "${shortname}" == "pc2" ]; then
  598. fn_default_config_local
  599. fn_list_config_locations
  600. elif [ "${shortname}" == "q2" ]; then
  601. array_configs+=(server.cfg)
  602. fn_default_config_remote
  603. fn_set_config_vars
  604. fn_list_config_locations
  605. elif [ "${shortname}" == "q3" ]; then
  606. array_configs+=(server.cfg)
  607. fn_fetch_default_configs
  608. fn_default_config_remote
  609. fn_set_config_vars
  610. fn_list_config_locations
  611. elif [ "${shortname}" == "q4" ]; then
  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}" == "ql" ]; then
  618. array_configs+=(server.cfg)
  619. fn_default_config_remote
  620. fn_set_config_vars
  621. fn_list_config_locations
  622. elif [ "${shortname}" == "jk2" ]; then
  623. array_configs+=(server.cfg)
  624. fn_default_config_remote
  625. fn_set_config_vars
  626. elif [ "${shortname}" == "qw" ]; then
  627. array_configs+=(server.cfg)
  628. fn_default_config_remote
  629. fn_set_config_vars
  630. fn_list_config_locations
  631. elif [ "${shortname}" == "ricochet" ]; then
  632. array_configs+=(server.cfg)
  633. fn_default_config_remote
  634. fn_set_config_vars
  635. fn_list_config_locations
  636. elif [ "${shortname}" == "rtcw" ]; then
  637. array_configs+=(server.cfg)
  638. fn_default_config_remote
  639. fn_set_config_vars
  640. fn_list_config_locations
  641. elif [ "${shortname}" == "rust" ]; then
  642. array_configs+=(server.cfg)
  643. fn_default_config_remote
  644. fn_list_config_locations
  645. elif [ "${shortname}" == "scpsl" ] || [ "${shortname}" == "scpslsm" ]; then
  646. array_configs+=(config_gameplay.txt config_localadmin.txt)
  647. fn_default_config_remote
  648. fn_set_config_vars
  649. fn_list_config_locations
  650. elif [ "${shortname}" == "sf" ]; then
  651. array_configs+=(GameUserSettings.ini)
  652. fn_default_config_remote
  653. fn_set_config_vars
  654. fn_list_config_locations
  655. elif [ "${shortname}" == "sm" ]; then
  656. fn_default_config_local
  657. fn_list_config_locations
  658. elif [ "${shortname}" == "sol" ]; then
  659. array_configs+=(soldat.ini)
  660. fn_default_config_remote
  661. fn_set_config_vars
  662. fn_list_config_locations
  663. elif [ "${shortname}" == "sof2" ]; then
  664. array_configs+=(server.cfg mapcycle.txt)
  665. fn_default_config_remote
  666. fn_set_config_vars
  667. fn_list_config_locations
  668. elif [ "${shortname}" == "sfc" ]; then
  669. array_configs+=(server.cfg)
  670. fn_default_config_remote
  671. fn_set_config_vars
  672. fn_list_config_locations
  673. elif [ "${shortname}" == "squad" ]; then
  674. array_configs+=(Admins.cfg Bans.cfg License.cfg Server.cfg Rcon.cfg)
  675. fn_default_config_remote
  676. fn_set_config_vars
  677. fn_list_config_locations
  678. elif [ "${shortname}" == "sb" ]; then
  679. array_configs+=(starbound_server.config)
  680. fn_default_config_remote
  681. fn_set_config_vars
  682. fn_list_config_locations
  683. elif [ "${shortname}" == "stn" ]; then
  684. array_configs+=(ServerConfig.txt ServerUsers.txt TpPresets.json UserPermissions.json)
  685. fn_default_config_remote
  686. fn_set_config_vars
  687. fn_list_config_locations
  688. elif [ "${shortname}" == "sven" ]; then
  689. array_configs+=(server.cfg)
  690. fn_default_config_remote
  691. fn_set_config_vars
  692. fn_list_config_locations
  693. elif [ "${shortname}" == "tf2" ]; then
  694. array_configs+=(server.cfg)
  695. fn_default_config_remote
  696. fn_set_config_vars
  697. fn_list_config_locations
  698. elif [ "${shortname}" == "tfc" ]; then
  699. array_configs+=(server.cfg)
  700. fn_default_config_remote
  701. fn_set_config_vars
  702. fn_list_config_locations
  703. elif [ "${shortname}" == "ti" ]; then
  704. array_configs+=(Game.ini Engine.ini)
  705. fn_default_config_remote
  706. fn_set_config_vars
  707. fn_list_config_locations
  708. elif [ "${shortname}" == "ts" ]; then
  709. array_configs+=(server.cfg)
  710. fn_default_config_remote
  711. fn_set_config_vars
  712. fn_list_config_locations
  713. elif [ "${shortname}" == "ts3" ]; then
  714. array_configs+=(ts3server.ini)
  715. fn_default_config_remote
  716. fn_list_config_locations
  717. elif [ "${shortname}" == "tw" ]; then
  718. array_configs+=(server.cfg ctf.cfg dm.cfg duel.cfg tdm.cfg)
  719. fn_default_config_remote
  720. fn_set_config_vars
  721. fn_list_config_locations
  722. elif [ "${shortname}" == "terraria" ]; then
  723. array_configs+=(serverconfig.txt)
  724. fn_default_config_remote
  725. fn_set_config_vars
  726. fn_list_config_locations
  727. elif [ "${shortname}" == "tu" ]; then
  728. array_configs+=(TowerServer.ini)
  729. fn_default_config_remote
  730. fn_set_config_vars
  731. fn_list_config_locations
  732. elif [ "${shortname}" == "ut" ]; then
  733. array_configs+=(Game.ini Engine.ini)
  734. fn_default_config_remote
  735. fn_set_config_vars
  736. fn_list_config_locations
  737. elif [ "${shortname}" == "ut2k4" ]; then
  738. array_configs+=(UT2004.ini)
  739. fn_default_config_remote
  740. fn_set_config_vars
  741. fn_list_config_locations
  742. elif [ "${shortname}" == "ut99" ]; then
  743. array_configs+=(Default.ini)
  744. fn_default_config_remote
  745. fn_set_config_vars
  746. fn_list_config_locations
  747. elif [ "${shortname}" == "unt" ]; then
  748. # Config is generated on first run
  749. :
  750. elif [ "${shortname}" == "vints" ]; then
  751. # Config is generated on first run
  752. :
  753. elif [ "${shortname}" == "vs" ]; then
  754. array_configs+=(server.cfg)
  755. fn_default_config_remote
  756. fn_set_config_vars
  757. fn_list_config_locations
  758. elif [ "${shortname}" == "wet" ]; then
  759. array_configs+=(server.cfg)
  760. fn_default_config_remote
  761. fn_set_config_vars
  762. fn_list_config_locations
  763. elif [ "${shortname}" == "wf" ]; then
  764. array_configs+=(server.cfg)
  765. fn_default_config_remote
  766. fn_set_config_vars
  767. fn_list_config_locations
  768. elif [ "${shortname}" == "wmc" ]; then
  769. array_configs+=(config.yml)
  770. fn_default_config_remote
  771. fn_set_config_vars
  772. fn_list_config_locations
  773. elif [ "${shortname}" == "xnt" ]; then
  774. array_configs+=(server.cfg)
  775. fn_fetch_default_config
  776. fn_default_config_remote
  777. fn_set_config_vars
  778. fn_list_config_locations
  779. elif [ "${shortname}" == "wurm" ]; then
  780. array_configs+=(server.cfg)
  781. fn_default_config_remote
  782. fn_set_config_vars
  783. fn_list_config_locations
  784. elif [ "${shortname}" == "zmr" ]; then
  785. array_configs+=(server.cfg)
  786. fn_default_config_remote
  787. fn_set_config_vars
  788. fn_list_config_locations
  789. elif [ "${shortname}" == "zps" ]; then
  790. array_configs+=(server.cfg)
  791. fn_default_config_remote
  792. fn_set_config_vars
  793. fn_list_config_locations
  794. fi