4
0

install_config.sh 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828
  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 "${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. if [ ! -e "${servercfgfullpath}" ] && [ ! -L "${servercfgfullpath}" ]; then
  34. cp "${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 "${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 "${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 "${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 to 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 "${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" "${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\"" "${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}" == "sdtd" ]; then
  244. fn_default_config_local
  245. fn_list_config_locations
  246. elif [ "${shortname}" == "ac" ]; then
  247. array_configs+=(server_cfg.ini)
  248. fn_default_config_remote
  249. fn_set_config_vars
  250. fn_list_config_locations
  251. elif [ "${shortname}" == "ahl" ]; then
  252. array_configs+=(server.cfg)
  253. fn_default_config_remote
  254. fn_set_config_vars
  255. fn_list_config_locations
  256. elif [ "${shortname}" == "ahl2" ]; then
  257. array_configs+=(server.cfg)
  258. fn_default_config_remote
  259. fn_set_config_vars
  260. fn_list_config_locations
  261. elif [ "${shortname}" == "ark" ]; then
  262. array_configs+=(GameUserSettings.ini)
  263. fn_default_config_remote
  264. fn_set_config_vars
  265. fn_list_config_locations
  266. elif [ "${shortname}" == "arma3" ]; then
  267. array_configs+=(server.cfg network.cfg)
  268. fn_default_config_remote
  269. fn_set_config_vars
  270. fn_list_config_locations
  271. elif [ "${shortname}" == "armar" ]; then
  272. array_configs+=(server.json)
  273. fn_default_config_remote
  274. fn_set_config_vars
  275. fn_list_config_locations
  276. elif [ "${shortname}" == "ats" ]; then
  277. array_configs+=(server_config.sii)
  278. fn_default_config_remote
  279. fn_set_config_vars
  280. fn_list_config_locations
  281. elif [ "${shortname}" == "bo" ]; then
  282. array_configs+=(config.txt)
  283. fn_default_config_remote
  284. fn_set_config_vars
  285. fn_list_config_locations
  286. elif [ "${shortname}" == "bd" ]; then
  287. array_configs+=(server.cfg)
  288. fn_default_config_remote
  289. fn_set_config_vars
  290. fn_list_config_locations
  291. elif [ "${shortname}" == "bt" ]; then
  292. array_configs+=(serversettings.xml)
  293. fn_default_config_remote
  294. fn_set_config_vars
  295. fn_list_config_locations
  296. elif [ "${shortname}" == "btl" ]; then
  297. fn_check_cfgdir
  298. array_configs+=(Game.ini)
  299. fn_default_config_remote
  300. fn_set_config_vars
  301. fn_list_config_locations
  302. elif [ "${shortname}" == "bf1942" ]; then
  303. array_configs+=(serversettings.con)
  304. fn_default_config_remote
  305. fn_set_config_vars
  306. fn_list_config_locations
  307. elif [ "${shortname}" == "bfv" ]; then
  308. array_configs+=(serversettings.con)
  309. fn_default_config_remote
  310. fn_set_config_vars
  311. fn_list_config_locations
  312. elif [ "${shortname}" == "bs" ]; then
  313. array_configs+=(server.cfg)
  314. fn_default_config_remote
  315. fn_set_config_vars
  316. fn_list_config_locations
  317. elif [ "${shortname}" == "bb" ]; then
  318. array_configs+=(server.cfg)
  319. fn_default_config_remote
  320. fn_set_config_vars
  321. fn_list_config_locations
  322. elif [ "${shortname}" == "bb2" ]; then
  323. array_configs+=(server.cfg)
  324. fn_default_config_remote
  325. fn_set_config_vars
  326. fn_list_config_locations
  327. elif [ "${shortname}" == "bmdm" ]; then
  328. array_configs+=(server.cfg)
  329. fn_default_config_remote
  330. fn_set_config_vars
  331. fn_list_config_locations
  332. elif [ "${shortname}" == "ck" ]; then
  333. array_configs+=(ServerConfig.json)
  334. fn_default_config_remote
  335. fn_set_config_vars
  336. fn_list_config_locations
  337. elif [ "${shortname}" == "cod" ]; then
  338. array_configs+=(server.cfg)
  339. fn_default_config_remote
  340. fn_set_config_vars
  341. fn_list_config_locations
  342. elif [ "${shortname}" == "coduo" ]; then
  343. array_configs+=(server.cfg)
  344. fn_default_config_remote
  345. fn_set_config_vars
  346. fn_list_config_locations
  347. elif [ "${shortname}" == "cod2" ]; then
  348. array_configs+=(server.cfg)
  349. fn_default_config_remote
  350. fn_set_config_vars
  351. fn_list_config_locations
  352. elif [ "${shortname}" == "cod4" ]; then
  353. array_configs+=(server.cfg)
  354. fn_default_config_remote
  355. fn_set_config_vars
  356. fn_list_config_locations
  357. elif [ "${shortname}" == "codwaw" ]; then
  358. array_configs+=(server.cfg)
  359. fn_default_config_remote
  360. fn_set_config_vars
  361. fn_list_config_locations
  362. elif [ "${shortname}" == "cc" ]; then
  363. array_configs+=(server.cfg)
  364. fn_default_config_remote
  365. fn_set_config_vars
  366. fn_list_config_locations
  367. elif [ "${shortname}" == "col" ]; then
  368. array_configs+=(colserver.json)
  369. fn_default_config_remote
  370. fn_set_config_vars
  371. fn_list_config_locations
  372. elif [ "${shortname}" == "cs" ]; then
  373. array_configs+=(server.cfg)
  374. fn_default_config_remote
  375. fn_set_config_vars
  376. fn_list_config_locations
  377. elif [ "${shortname}" == "cs2" ]; then
  378. array_configs+=(server.cfg)
  379. fn_default_config_remote
  380. fn_set_config_vars
  381. fn_list_config_locations
  382. elif [ "${shortname}" == "cscz" ]; then
  383. array_configs+=(server.cfg)
  384. fn_default_config_remote
  385. fn_set_config_vars
  386. fn_list_config_locations
  387. elif [ "${shortname}" == "csgo" ]; then
  388. array_configs+=(server.cfg)
  389. fn_default_config_remote
  390. fn_set_config_vars
  391. fn_list_config_locations
  392. elif [ "${shortname}" == "css" ]; then
  393. array_configs+=(server.cfg)
  394. fn_default_config_remote
  395. fn_set_config_vars
  396. fn_list_config_locations
  397. elif [ "${shortname}" == "ct" ]; then
  398. array_configs+=(ServerSetting.ini)
  399. fn_default_config_remote
  400. fn_set_config_vars
  401. fn_list_config_locations
  402. elif [ "${shortname}" == "dayz" ]; then
  403. array_configs+=(server.cfg)
  404. fn_default_config_remote
  405. fn_set_config_vars
  406. fn_list_config_locations
  407. elif [ "${shortname}" == "dod" ]; then
  408. array_configs+=(server.cfg)
  409. fn_default_config_remote
  410. fn_set_config_vars
  411. fn_list_config_locations
  412. elif [ "${shortname}" == "dodr" ]; then
  413. array_configs+=(Game.ini)
  414. fn_default_config_remote
  415. fn_list_config_locations
  416. elif [ "${shortname}" == "dods" ]; then
  417. array_configs+=(server.cfg)
  418. fn_default_config_remote
  419. fn_set_config_vars
  420. fn_list_config_locations
  421. elif [ "${shortname}" == "doi" ]; then
  422. array_configs+=(server.cfg)
  423. fn_default_config_remote
  424. fn_set_config_vars
  425. fn_list_config_locations
  426. elif [ "${shortname}" == "dmc" ]; then
  427. array_configs+=(server.cfg)
  428. fn_default_config_remote
  429. fn_set_config_vars
  430. fn_list_config_locations
  431. elif [ "${shortname}" == "dst" ]; then
  432. array_configs+=(cluster.ini server.ini)
  433. fn_default_config_remote
  434. fn_set_dst_config_vars
  435. fn_list_config_locations
  436. elif [ "${shortname}" == "dab" ]; then
  437. array_configs+=(server.cfg)
  438. fn_default_config_remote
  439. fn_set_config_vars
  440. fn_list_config_locations
  441. elif [ "${shortname}" == "dys" ]; then
  442. array_configs+=(server.cfg)
  443. fn_default_config_remote
  444. fn_set_config_vars
  445. fn_list_config_locations
  446. elif [ "${shortname}" == "eco" ]; then
  447. array_configs+=(Network.eco)
  448. fn_default_config_remote
  449. fn_set_config_vars
  450. fn_list_config_locations
  451. elif [ "${shortname}" == "em" ]; then
  452. fn_default_config_local
  453. fn_list_config_locations
  454. elif [ "${shortname}" == "etl" ]; then
  455. array_configs+=(server.cfg)
  456. fn_default_config_remote
  457. fn_set_config_vars
  458. fn_list_config_locations
  459. elif [ "${shortname}" == "ets2" ]; then
  460. array_configs+=(server_config.sii)
  461. fn_default_config_remote
  462. fn_set_config_vars
  463. fn_list_config_locations
  464. elif [ "${shortname}" == "fctr" ]; then
  465. array_configs+=(server-settings.json)
  466. fn_default_config_remote
  467. fn_set_config_vars
  468. fn_list_config_locations
  469. elif [ "${shortname}" == "fof" ]; then
  470. array_configs+=(server.cfg)
  471. fn_default_config_remote
  472. fn_set_config_vars
  473. fn_list_config_locations
  474. elif [ "${shortname}" == "gmod" ]; then
  475. array_configs+=(server.cfg)
  476. fn_default_config_remote
  477. fn_set_config_vars
  478. fn_list_config_locations
  479. elif [ "${shortname}" == "hldm" ]; then
  480. array_configs+=(server.cfg)
  481. fn_default_config_remote
  482. fn_set_config_vars
  483. fn_list_config_locations
  484. elif [ "${shortname}" == "hldms" ]; then
  485. array_configs+=(server.cfg)
  486. fn_default_config_remote
  487. fn_set_config_vars
  488. fn_list_config_locations
  489. elif [ "${shortname}" == "ohd" ]; then
  490. array_configs+=(Admins.cfg Engine.ini Game.ini MapCycle.cfg)
  491. fn_default_config_remote
  492. fn_set_config_vars
  493. fn_list_config_locations
  494. elif [ "${shortname}" == "opfor" ]; then
  495. array_configs+=(server.cfg)
  496. fn_default_config_remote
  497. fn_set_config_vars
  498. fn_list_config_locations
  499. elif [ "${shortname}" == "hl2dm" ]; then
  500. array_configs+=(server.cfg)
  501. fn_default_config_remote
  502. fn_set_config_vars
  503. fn_list_config_locations
  504. elif [ "${shortname}" == "hz" ]; then
  505. # Config is generated on first run
  506. :
  507. elif [ "${shortname}" == "ins" ]; then
  508. array_configs+=(server.cfg)
  509. fn_default_config_remote
  510. fn_set_config_vars
  511. fn_list_config_locations
  512. elif [ "${shortname}" == "ios" ]; then
  513. array_configs+=(server.cfg)
  514. fn_default_config_remote
  515. fn_set_config_vars
  516. fn_list_config_locations
  517. elif [ "${shortname}" == "jc2" ]; then
  518. array_configs+=(config.lua)
  519. fn_default_config_remote
  520. fn_set_config_vars
  521. fn_list_config_locations
  522. elif [ "${shortname}" == "jc3" ]; then
  523. array_configs+=(config.json)
  524. fn_default_config_remote
  525. fn_set_config_vars
  526. fn_list_config_locations
  527. elif [ "${shortname}" == "kf" ]; then
  528. array_configs+=(Default.ini)
  529. fn_default_config_remote
  530. fn_set_config_vars
  531. fn_list_config_locations
  532. elif [ "${shortname}" == "l4d" ]; then
  533. array_configs+=(server.cfg)
  534. fn_default_config_remote
  535. fn_set_config_vars
  536. fn_list_config_locations
  537. elif [ "${shortname}" == "l4d2" ]; then
  538. array_configs+=(server.cfg)
  539. fn_default_config_remote
  540. fn_set_config_vars
  541. fn_list_config_locations
  542. elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then
  543. array_configs+=(server.properties)
  544. fn_default_config_remote
  545. fn_set_config_vars
  546. fn_list_config_locations
  547. elif [ "${shortname}" == "mcb" ]; then
  548. array_configs+=(server.properties)
  549. fn_default_config_remote
  550. fn_set_config_vars
  551. fn_list_config_locations
  552. elif [ "${shortname}" == "mohaa" ]; then
  553. array_configs+=(server.cfg)
  554. fn_default_config_remote
  555. fn_set_config_vars
  556. fn_list_config_locations
  557. elif [ "${shortname}" == "mh" ]; then
  558. array_configs+=(Game.ini)
  559. fn_default_config_remote
  560. fn_set_config_vars
  561. fn_list_config_locations
  562. elif [ "${shortname}" == "ns" ]; then
  563. array_configs+=(server.cfg)
  564. fn_default_config_remote
  565. fn_set_config_vars
  566. fn_list_config_locations
  567. elif [ "${shortname}" == "nmrih" ]; then
  568. array_configs+=(server.cfg)
  569. fn_default_config_remote
  570. fn_set_config_vars
  571. fn_list_config_locations
  572. elif [ "${shortname}" == "nd" ]; then
  573. array_configs+=(server.cfg)
  574. fn_default_config_remote
  575. fn_set_config_vars
  576. fn_list_config_locations
  577. elif [ "${shortname}" == "mta" ]; then
  578. array_configs+=(acl.xml mtaserver.conf vehiclecolors.conf)
  579. fn_default_config_remote
  580. fn_list_config_locations
  581. elif [ "${shortname}" == "pvr" ]; then
  582. array_configs+=(Game.ini)
  583. fn_default_config_remote
  584. fn_set_config_vars
  585. elif [ "${shortname}" == "pvkii" ]; then
  586. array_configs+=(server.cfg)
  587. fn_default_config_remote
  588. fn_set_config_vars
  589. fn_list_config_locations
  590. elif [ "${shortname}" == "pw" ]; then
  591. array_configs+=(PalWorldSettings.ini)
  592. fn_default_config_remote
  593. fn_set_config_vars
  594. fn_list_config_locations
  595. elif [ "${shortname}" == "pz" ]; then
  596. array_configs+=(server.ini)
  597. fn_default_config_remote
  598. fn_set_config_vars
  599. fn_list_config_locations
  600. elif [ "${shortname}" == "nec" ]; then
  601. array_configs+=(server.cfg)
  602. fn_default_config_remote
  603. fn_set_config_vars
  604. fn_list_config_locations
  605. elif [ "${shortname}" == "pc" ]; then
  606. array_configs+=(server.cfg)
  607. fn_default_config_remote
  608. fn_set_config_vars
  609. fn_list_config_locations
  610. elif [ "${shortname}" == "pc2" ]; then
  611. fn_default_config_local
  612. fn_list_config_locations
  613. elif [ "${shortname}" == "q2" ]; then
  614. array_configs+=(server.cfg)
  615. fn_default_config_remote
  616. fn_set_config_vars
  617. fn_list_config_locations
  618. elif [ "${shortname}" == "q3" ]; then
  619. array_configs+=(server.cfg)
  620. fn_default_config_remote
  621. fn_set_config_vars
  622. fn_list_config_locations
  623. elif [ "${shortname}" == "q4" ]; then
  624. array_configs+=(server.cfg)
  625. fn_default_config_remote
  626. fn_set_config_vars
  627. fn_list_config_locations
  628. elif [ "${shortname}" == "ql" ]; then
  629. array_configs+=(server.cfg)
  630. fn_default_config_remote
  631. fn_set_config_vars
  632. fn_list_config_locations
  633. elif [ "${shortname}" == "jk2" ]; then
  634. array_configs+=(server.cfg)
  635. fn_default_config_remote
  636. fn_set_config_vars
  637. elif [ "${shortname}" == "qw" ]; then
  638. array_configs+=(server.cfg)
  639. fn_default_config_remote
  640. fn_set_config_vars
  641. fn_list_config_locations
  642. elif [ "${shortname}" == "ricochet" ]; then
  643. array_configs+=(server.cfg)
  644. fn_default_config_remote
  645. fn_set_config_vars
  646. fn_list_config_locations
  647. elif [ "${shortname}" == "rtcw" ]; then
  648. array_configs+=(server.cfg)
  649. fn_default_config_remote
  650. fn_set_config_vars
  651. fn_list_config_locations
  652. elif [ "${shortname}" == "rust" ]; then
  653. array_configs+=(server.cfg)
  654. fn_default_config_remote
  655. fn_list_config_locations
  656. elif [ "${shortname}" == "scpsl" ] || [ "${shortname}" == "scpslsm" ]; then
  657. array_configs+=(config_gameplay.txt config_localadmin.txt)
  658. fn_default_config_remote
  659. fn_set_config_vars
  660. fn_list_config_locations
  661. elif [ "${shortname}" == "sf" ]; then
  662. array_configs+=(GameUserSettings.ini)
  663. fn_default_config_remote
  664. fn_set_config_vars
  665. fn_list_config_locations
  666. elif [ "${shortname}" == "sol" ]; then
  667. array_configs+=(soldat.ini)
  668. fn_default_config_remote
  669. fn_set_config_vars
  670. fn_list_config_locations
  671. elif [ "${shortname}" == "sof2" ]; then
  672. array_configs+=(server.cfg mapcycle.txt)
  673. fn_default_config_remote
  674. fn_set_config_vars
  675. fn_list_config_locations
  676. elif [ "${shortname}" == "sfc" ]; then
  677. array_configs+=(server.cfg)
  678. fn_default_config_remote
  679. fn_set_config_vars
  680. fn_list_config_locations
  681. elif [ "${shortname}" == "squad" ]; then
  682. array_configs+=(Admins.cfg Bans.cfg License.cfg Server.cfg Rcon.cfg)
  683. fn_default_config_remote
  684. fn_set_config_vars
  685. fn_list_config_locations
  686. elif [ "${shortname}" == "sb" ]; then
  687. array_configs+=(starbound_server.config)
  688. fn_default_config_remote
  689. fn_set_config_vars
  690. fn_list_config_locations
  691. elif [ "${shortname}" == "st" ]; then
  692. array_configs+=(setting.xml)
  693. fn_default_config_remote
  694. fn_set_config_vars
  695. fn_list_config_locations
  696. elif [ "${shortname}" == "stn" ]; then
  697. array_configs+=(ServerConfig.txt ServerUsers.txt TpPresets.json UserPermissions.json)
  698. fn_default_config_remote
  699. fn_set_config_vars
  700. fn_list_config_locations
  701. elif [ "${shortname}" == "sven" ]; then
  702. array_configs+=(server.cfg)
  703. fn_default_config_remote
  704. fn_set_config_vars
  705. fn_list_config_locations
  706. elif [ "${shortname}" == "tf2" ]; then
  707. array_configs+=(server.cfg)
  708. fn_default_config_remote
  709. fn_set_config_vars
  710. fn_list_config_locations
  711. elif [ "${shortname}" == "tf2c" ]; then
  712. array_configs+=(server.cfg)
  713. fn_default_config_remote
  714. fn_set_config_vars
  715. fn_list_config_locations
  716. elif [ "${shortname}" == "tfc" ]; then
  717. array_configs+=(server.cfg)
  718. fn_default_config_remote
  719. fn_set_config_vars
  720. fn_list_config_locations
  721. elif [ "${shortname}" == "ti" ]; then
  722. array_configs+=(Game.ini Engine.ini)
  723. fn_default_config_remote
  724. fn_set_config_vars
  725. fn_list_config_locations
  726. elif [ "${shortname}" == "ts" ]; then
  727. array_configs+=(server.cfg)
  728. fn_default_config_remote
  729. fn_set_config_vars
  730. fn_list_config_locations
  731. elif [ "${shortname}" == "ts3" ]; then
  732. array_configs+=(ts3server.ini)
  733. fn_default_config_remote
  734. fn_list_config_locations
  735. elif [ "${shortname}" == "tw" ]; then
  736. array_configs+=(server.cfg ctf.cfg dm.cfg duel.cfg tdm.cfg)
  737. fn_default_config_remote
  738. fn_set_config_vars
  739. fn_list_config_locations
  740. elif [ "${shortname}" == "terraria" ]; then
  741. array_configs+=(serverconfig.txt)
  742. fn_default_config_remote
  743. fn_set_config_vars
  744. fn_list_config_locations
  745. elif [ "${shortname}" == "tu" ]; then
  746. array_configs+=(TowerServer.ini)
  747. fn_default_config_remote
  748. fn_set_config_vars
  749. fn_list_config_locations
  750. elif [ "${shortname}" == "ut" ]; then
  751. array_configs+=(Game.ini Engine.ini)
  752. fn_default_config_remote
  753. fn_set_config_vars
  754. fn_list_config_locations
  755. elif [ "${shortname}" == "ut2k4" ]; then
  756. array_configs+=(UT2004.ini)
  757. fn_default_config_remote
  758. fn_set_config_vars
  759. fn_list_config_locations
  760. elif [ "${shortname}" == "ut99" ]; then
  761. array_configs+=(Default.ini)
  762. fn_default_config_remote
  763. fn_set_config_vars
  764. fn_list_config_locations
  765. elif [ "${shortname}" == "unt" ]; then
  766. # Config is generated on first run
  767. :
  768. elif [ "${shortname}" == "vints" ]; then
  769. # Config is generated on first run
  770. :
  771. elif [ "${shortname}" == "vs" ]; then
  772. array_configs+=(server.cfg)
  773. fn_default_config_remote
  774. fn_set_config_vars
  775. fn_list_config_locations
  776. elif [ "${shortname}" == "wet" ]; then
  777. array_configs+=(server.cfg)
  778. fn_default_config_remote
  779. fn_set_config_vars
  780. fn_list_config_locations
  781. elif [ "${shortname}" == "wf" ]; then
  782. array_configs+=(server.cfg)
  783. fn_default_config_remote
  784. fn_set_config_vars
  785. fn_list_config_locations
  786. elif [ "${shortname}" == "wmc" ]; then
  787. array_configs+=(config.yml)
  788. fn_default_config_remote
  789. fn_set_config_vars
  790. fn_list_config_locations
  791. elif [ "${shortname}" == "xnt" ]; then
  792. fix_xnt.sh
  793. array_configs+=(server.cfg)
  794. fn_default_config_remote
  795. fn_set_config_vars
  796. fn_list_config_locations
  797. elif [ "${shortname}" == "wurm" ]; then
  798. array_configs+=(server.cfg)
  799. fn_default_config_remote
  800. fn_set_config_vars
  801. fn_list_config_locations
  802. elif [ "${shortname}" == "zmr" ]; then
  803. array_configs+=(server.cfg)
  804. fn_default_config_remote
  805. fn_set_config_vars
  806. fn_list_config_locations
  807. elif [ "${shortname}" == "zps" ]; then
  808. array_configs+=(server.cfg)
  809. fn_default_config_remote
  810. fn_set_config_vars
  811. fn_list_config_locations
  812. fi