install_config.sh 25 KB

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