install_config.sh 24 KB

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