install_config.sh 24 KB

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