install_config.sh 28 KB

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