install_config.sh 24 KB

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