tests_jc2server.sh 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179
  1. #!/bin/bash
  2. # Project: Game Server Managers - LinuxGSM
  3. # Author: Daniel Gibbs
  4. # License: MIT License, Copyright (c) 2020 Daniel Gibbs
  5. # Purpose: Travis CI Tests: Just Cause 2 | Linux Game Server Management Script
  6. # Contributors: https://linuxgsm.com/contrib
  7. # Documentation: https://docs.linuxgsm.com
  8. # Website: https://linuxgsm.com
  9. # DO NOT EDIT THIS FILE
  10. # LinuxGSM configuration is no longer edited here
  11. # To update your LinuxGSM config go to:
  12. # lgsm/config-lgsm
  13. # https://docs.linuxgsm.com/configuration/linuxgsm-config
  14. # Debugging
  15. if [ -f ".dev-debug" ]; then
  16. exec 5>dev-debug.log
  17. BASH_XTRACEFD="5"
  18. set -x
  19. fi
  20. version="v20.1.5"
  21. shortname="jc2"
  22. gameservername="jc2server"
  23. rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
  24. selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")
  25. lgsmdir="${rootdir}/lgsm"
  26. logdir="${rootdir}/log"
  27. lgsmlogdir="${logdir}/lgsm"
  28. steamcmddir="${rootdir}/steamcmd"
  29. serverfiles="${rootdir}/serverfiles"
  30. functionsdir="${lgsmdir}/functions"
  31. tmpdir="${lgsmdir}/tmp"
  32. datadir="${lgsmdir}/data"
  33. lockdir="${lgsmdir}/lock"
  34. serverlist="${datadir}/serverlist.csv"
  35. serverlistmenu="${datadir}/serverlistmenu.csv"
  36. configdir="${lgsmdir}/config-lgsm"
  37. configdirserver="${configdir}/${gameservername}"
  38. configdirdefault="${lgsmdir}/config-default"
  39. userinput="${1}"
  40. # Allows for testing not on Travis CI
  41. if [ ! -v TRAVIS ]; then
  42. TRAVIS_BRANCH="develop"
  43. TRAVIS_BUILD_DIR="${rootdir}"
  44. else
  45. selfname="travis"
  46. travistest="1"
  47. fi
  48. ## GitHub Branch Select
  49. # Allows for the use of different function files
  50. # from a different repo and/or branch.
  51. githubuser="GameServerManagers"
  52. githubrepo="LinuxGSM"
  53. githubbranch="${TRAVIS_BRANCH}"
  54. # Core function that is required first.
  55. core_functions.sh(){
  56. functionfile="${FUNCNAME[0]}"
  57. fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5"
  58. }
  59. # Bootstrap
  60. # Fetches the core functions required before passed off to core_dl.sh.
  61. fn_bootstrap_fetch_file(){
  62. remote_fileurl="${1}"
  63. local_filedir="${2}"
  64. local_filename="${3}"
  65. chmodx="${4:-0}"
  66. run="${5:-0}"
  67. forcedl="${6:-0}"
  68. md5="${7:-0}"
  69. # Download file if missing or download forced.
  70. if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then
  71. if [ ! -d "${local_filedir}" ]; then
  72. mkdir -p "${local_filedir}"
  73. fi
  74. # If curl exists download file.
  75. if [ "$(command -v curl 2>/dev/null)" ]; then
  76. # Trap to remove part downloaded files.
  77. echo -en " fetching ${local_filename}...\c"
  78. curlcmd=$(curl -s --fail -L -o "${local_filedir}/${local_filename}" "${remote_fileurl}" 2>&1)
  79. local exitcode=$?
  80. if [ ${exitcode} -ne 0 ]; then
  81. echo -e "FAIL"
  82. if [ -f "${lgsmlog}" ]; then
  83. echo -e "${remote_fileurl}" | tee -a "${lgsmlog}"
  84. echo -e "${curlcmd}" | tee -a "${lgsmlog}"
  85. fi
  86. exit 1
  87. else
  88. echo -e "OK"
  89. fi
  90. else
  91. echo -e "[ FAIL ] Curl is not installed"
  92. exit 1
  93. fi
  94. # Make file chmodx if chmodx is set.
  95. if [ "${chmodx}" == "chmodx" ]; then
  96. chmod +x "${local_filedir}/${local_filename}"
  97. fi
  98. fi
  99. if [ -f "${local_filedir}/${local_filename}" ]; then
  100. # Run file if run is set.
  101. if [ "${run}" == "run" ]; then
  102. # shellcheck source=/dev/null
  103. source "${local_filedir}/${local_filename}"
  104. fi
  105. fi
  106. }
  107. fn_bootstrap_fetch_file_github(){
  108. github_file_url_dir="${1}"
  109. github_file_url_name="${2}"
  110. githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
  111. remote_fileurl="${githuburl}"
  112. local_filedir="${3}"
  113. local_filename="${github_file_url_name}"
  114. chmodx="${4:-0}"
  115. run="${5:-0}"
  116. forcedl="${6:-0}"
  117. md5="${7:-0}"
  118. # Passes vars to the file download function.
  119. fn_bootstrap_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}"
  120. }
  121. # Installer menu.
  122. fn_print_center() {
  123. columns=$(tput cols)
  124. line="$*"
  125. printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}"
  126. }
  127. fn_print_horizontal(){
  128. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "="
  129. }
  130. # Bash menu.
  131. fn_install_menu_bash() {
  132. local resultvar=$1
  133. title=$2
  134. caption=$3
  135. options=$4
  136. fn_print_horizontal
  137. fn_print_center "${title}"
  138. fn_print_center "${caption}"
  139. fn_print_horizontal
  140. menu_options=()
  141. while read -r line || [[ -n "${line}" ]]; do
  142. var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}')
  143. menu_options+=( "${var}" )
  144. done < "${options}"
  145. menu_options+=( "Cancel" )
  146. select option in "${menu_options[@]}"; do
  147. if [ "${option}" ]&&[ "${option}" != "Cancel" ]; then
  148. eval "$resultvar=\"${option/%\ */}\""
  149. fi
  150. break
  151. done
  152. }
  153. # Whiptail/Dialog menu.
  154. fn_install_menu_whiptail() {
  155. local menucmd=$1
  156. local resultvar=$2
  157. title=$3
  158. caption=$4
  159. options=$5
  160. height=${6:-40}
  161. width=${7:-80}
  162. menuheight=${8:-30}
  163. IFS=","
  164. menu_options=()
  165. while read -r line; do
  166. key=$(echo -e "${line}" | awk -F "," '{print $3}')
  167. val=$(echo -e "${line}" | awk -F "," '{print $2}')
  168. menu_options+=( "${val//\"}" "${key//\"}" )
  169. done < "${options}"
  170. OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3)
  171. if [ $? == 0 ]; then
  172. eval "$resultvar=\"${OPTION}\""
  173. else
  174. eval "$resultvar="
  175. fi
  176. }
  177. # Menu selector.
  178. fn_install_menu() {
  179. local resultvar=$1
  180. local selection=""
  181. title=$2
  182. caption=$3
  183. options=$4
  184. # Get menu command.
  185. for menucmd in whiptail dialog bash; do
  186. if [ "$(command -v "${menucmd}")" ]; then
  187. menucmd=$(command -v "${menucmd}")
  188. break
  189. fi
  190. done
  191. case "$(basename "${menucmd}")" in
  192. whiptail|dialog)
  193. fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;;
  194. *)
  195. fn_install_menu_bash selection "${title}" "${caption}" "${options}";;
  196. esac
  197. eval "$resultvar=\"${selection}\""
  198. }
  199. # Gets server info from serverlist.csv and puts in to array.
  200. fn_server_info(){
  201. IFS=","
  202. server_info_array=($(grep -aw "${userinput}" "${serverlist}"))
  203. shortname="${server_info_array[0]}" # csgo
  204. gameservername="${server_info_array[1]}" # csgoserver
  205. gamename="${server_info_array[2]}" # Counter Strike: Global Offensive
  206. }
  207. fn_install_getopt(){
  208. userinput="empty"
  209. echo -e "Usage: $0 [option]"
  210. echo -e ""
  211. echo -e "Installer - Linux Game Server Managers - Version ${version}"
  212. echo -e "https://linuxgsm.com"
  213. echo -e ""
  214. echo -e "Commands"
  215. echo -e "install\t\t| Select server to install."
  216. echo -e "servername\t| Enter name of game server to install. e.g $0 csgoserver."
  217. echo -e "list\t\t| List all servers available for install."
  218. exit
  219. }
  220. fn_install_file(){
  221. local_filename="${gameservername}"
  222. if [ -e "${local_filename}" ]; then
  223. i=2
  224. while [ -e "${local_filename}-${i}" ] ; do
  225. let i++
  226. done
  227. local_filename="${local_filename}-${i}"
  228. fi
  229. cp -R "${selfname}" "${local_filename}"
  230. sed -i -e "s/shortname=\"core\"/shortname=\"${shortname}\"/g" "${local_filename}"
  231. sed -i -e "s/gameservername=\"core\"/gameservername=\"${gameservername}\"/g" "${local_filename}"
  232. echo -e "Installed ${gamename} server as ${local_filename}"
  233. echo -e ""
  234. if [ ! -d "${serverfiles}" ]; then
  235. echo -e "./${local_filename} install"
  236. else
  237. echo -e "Remember to check server ports"
  238. echo -e "./${local_filename} details"
  239. fi
  240. echo -e ""
  241. exit
  242. }
  243. # Prevent LinuxGSM from running as root. Except if doing a dependency install.
  244. if [ "$(whoami)" == "root" ]; then
  245. if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then
  246. if [ "${shortname}" == "core" ]; then
  247. echo -e "[ FAIL ] Do NOT run this script as root!"
  248. exit 1
  249. fi
  250. elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then
  251. echo -e "[ FAIL ] Do NOT run this script as root!"
  252. exit 1
  253. else
  254. core_functions.sh
  255. check_root.sh
  256. fi
  257. fi
  258. # LinuxGSM installer mode.
  259. if [ "${shortname}" == "core" ]; then
  260. # Download the latest serverlist. This is the complete list of all supported servers.
  261. fn_bootstrap_fetch_file_github "lgsm/data" "serverlist.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nomd5"
  262. if [ ! -f "${serverlist}" ]; then
  263. echo -e "[ FAIL ] serverlist.csv could not be loaded."
  264. exit 1
  265. fi
  266. if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then
  267. {
  268. tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}'
  269. } | column -s $'\t' -t | more
  270. exit
  271. elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then
  272. tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}"
  273. fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}"
  274. userinput="${result}"
  275. fn_server_info
  276. if [ "${result}" == "${gameservername}" ]; then
  277. fn_install_file
  278. elif [ "${result}" == "" ]; then
  279. echo -e "Install canceled"
  280. else
  281. echo -e "[ FAIL ] menu result does not match gameservername"
  282. echo -e "result: ${result}"
  283. echo -e "gameservername: ${gameservername}"
  284. fi
  285. elif [ "${userinput}" ]; then
  286. fn_server_info
  287. if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then
  288. fn_install_file
  289. else
  290. echo -e "[ FAIL ] unknown game server"
  291. fi
  292. else
  293. fn_install_getopt
  294. fi
  295. # LinuxGSM server mode.
  296. else
  297. core_functions.sh
  298. if [ "${shortname}" != "core-dep" ]; then
  299. # Load LinuxGSM configs.
  300. # These are required to get all the default variables for the specific server.
  301. # Load the default config. If missing download it. If changed reload it.
  302. if [ ! -f "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" ]; then
  303. mkdir -p "${configdirdefault}/config-lgsm/${gameservername}"
  304. fn_fetch_config "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "_default.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
  305. fi
  306. if [ ! -f "${configdirserver}/_default.cfg" ]; then
  307. mkdir -p "${configdirserver}"
  308. echo -en " copying _default.cfg...\c"
  309. cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
  310. exitcode=$?
  311. if [ ${exitcode} -ne 0 ]; then
  312. echo -e "FAIL"
  313. exit 1
  314. else
  315. echo -e "OK"
  316. fi
  317. else
  318. function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg")
  319. if [ "${function_file_diff}" != "" ]; then
  320. fn_print_warn_nl "_default.cfg has been altered. reloading config."
  321. echo -en " copying _default.cfg...\c"
  322. cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg"
  323. exitcode=$?
  324. if [ ${exitcode} -ne 0 ]; then
  325. echo -e "FAIL"
  326. exit 1
  327. else
  328. echo -e "OK"
  329. fi
  330. fi
  331. fi
  332. source "${configdirserver}/_default.cfg"
  333. # Load the common.cfg config. If missing download it.
  334. if [ ! -f "${configdirserver}/common.cfg" ]; then
  335. fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
  336. source "${configdirserver}/common.cfg"
  337. else
  338. source "${configdirserver}/common.cfg"
  339. fi
  340. # Load the instance.cfg config. If missing download it.
  341. if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
  342. fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
  343. source "${configdirserver}/${selfname}.cfg"
  344. else
  345. source "${configdirserver}/${selfname}.cfg"
  346. fi
  347. # Load the linuxgsm.sh in to tmpdir. If missing download it.
  348. if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then
  349. fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "chmodx" "norun" "noforcedl" "nomd5"
  350. fi
  351. fi
  352. # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off.
  353. fn_ansi_loader
  354. # Prevents running of core_exit.sh for Travis-CI.
  355. if [ -z "${travistest}" ]; then
  356. getopt=$1
  357. core_getopt.sh
  358. fi
  359. fi
  360. fn_currentstatus_tmux(){
  361. check_status.sh
  362. if [ "${status}" != "0" ]; then
  363. currentstatus="ONLINE"
  364. else
  365. currentstatus="OFFLINE"
  366. fi
  367. }
  368. fn_currentstatus_ts3(){
  369. check_status.sh
  370. if [ "${status}" != "0" ]; then
  371. currentstatus="ONLINE"
  372. else
  373. currentstatus="OFFLINE"
  374. fi
  375. }
  376. fn_setstatus(){
  377. fn_currentstatus_tmux
  378. echo""
  379. echo -e "Required status: ${requiredstatus}"
  380. counter=0
  381. echo -e "Current status: ${currentstatus}"
  382. while [ "${requiredstatus}" != "${currentstatus}" ]; do
  383. counter=$((counter+1))
  384. fn_currentstatus_tmux
  385. echo -en "New status: ${currentstatus}\\r"
  386. if [ "${requiredstatus}" == "ONLINE" ]; then
  387. (command_start.sh > /dev/null 2>&1)
  388. else
  389. (command_stop.sh > /dev/null 2>&1)
  390. fi
  391. if [ "${counter}" -gt "5" ]; then
  392. currentstatus="FAIL"
  393. echo -e "Current status: ${currentstatus}"
  394. echo -e ""
  395. echo -e "Unable to start or stop server."
  396. exit 1
  397. fi
  398. done
  399. echo -en "New status: ${currentstatus}\\r"
  400. echo -e "\n"
  401. echo -e "Test starting:"
  402. echo -e ""
  403. }
  404. # End of every test will expect the result to either pass or fail
  405. # If the script does not do as intended the whole test will fail
  406. # if expecting a pass
  407. fn_test_result_pass(){
  408. if [ $? != 0 ]; then
  409. echo -e "================================="
  410. echo -e "Expected result: PASS"
  411. echo -e "Actual result: FAIL"
  412. fn_print_fail_nl "TEST FAILED"
  413. exitcode=1
  414. core_exit.sh
  415. else
  416. echo -e "================================="
  417. echo -e "Expected result: PASS"
  418. echo -e "Actual result: PASS"
  419. fn_print_ok_nl "TEST PASSED"
  420. echo -e ""
  421. fi
  422. }
  423. # if expecting a fail
  424. fn_test_result_fail(){
  425. if [ $? == 0 ]; then
  426. echo -e "================================="
  427. echo -e "Expected result: FAIL"
  428. echo -e "Actual result: PASS"
  429. fn_print_fail_nl "TEST FAILED"
  430. exitcode=1
  431. core_exit.sh
  432. else
  433. echo -e "================================="
  434. echo -e "Expected result: FAIL"
  435. echo -e "Actual result: FAIL"
  436. fn_print_ok_nl "TEST PASSED"
  437. echo -e ""
  438. fi
  439. }
  440. # test result n/a
  441. fn_test_result_na(){
  442. echo -e "================================="
  443. echo -e "Expected result: N/A"
  444. echo -e "Actual result: N/A"
  445. fn_print_fail_nl "TEST N/A"
  446. }
  447. sleeptime="0"
  448. echo -e "================================="
  449. echo -e "Travis CI Tests"
  450. echo -e "Linux Game Server Manager"
  451. echo -e "by Daniel Gibbs"
  452. echo -e "Contributors: http://goo.gl/qLmitD"
  453. echo -e "https://linuxgsm.com"
  454. echo -e "================================="
  455. echo -e ""
  456. echo -e "================================="
  457. echo -e "Server Tests"
  458. echo -e "Using: ${gamename}"
  459. echo -e "Testing Branch: $TRAVIS_BRANCH"
  460. echo -e "================================="
  461. echo -e ""
  462. echo -e "0.0 - Pre-test Tasks"
  463. echo -e "=================================================================="
  464. echo -e "Description:"
  465. echo -e "Create log dir's"
  466. echo -e ""
  467. echo -e ""
  468. echo -e "0.1 - Create log dir's"
  469. echo -e "================================="
  470. echo -e ""
  471. (
  472. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  473. BASH_XTRACEFD="5"
  474. set -x
  475. install_logs.sh
  476. )
  477. echo -e "run order"
  478. echo -e "================="
  479. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  480. echo -e ""
  481. echo -e "0.2 - Enable dev-debug"
  482. echo -e "================================="
  483. echo -e "Description:"
  484. echo -e "Enable dev-debug"
  485. echo -e ""
  486. (
  487. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  488. BASH_XTRACEFD="5"
  489. set -x
  490. command_dev_debug.sh
  491. )
  492. fn_test_result_pass
  493. echo -e "run order"
  494. echo -e "================="
  495. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  496. echo -e ""
  497. echo -e "1.0 - Pre-install tests"
  498. echo -e "=================================================================="
  499. echo -e ""
  500. echo -e "1.1 - start - no files"
  501. echo -e "================================="
  502. echo -e "Description:"
  503. echo -e "test script reaction to missing server files."
  504. echo -e "Command: ./${gameservername} start"
  505. echo -e ""
  506. # Allows for testing not on Travis CI
  507. if [ ! -v TRAVIS ]; then
  508. (
  509. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  510. BASH_XTRACEFD="5"
  511. set -x
  512. command_start.sh
  513. )
  514. fn_test_result_fail
  515. else
  516. echo -e "Test bypassed"
  517. fi
  518. echo -e "run order"
  519. echo -e "================="
  520. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  521. echo -e ""
  522. echo -e "1.2 - getopt"
  523. echo -e "================================="
  524. echo -e "Description:"
  525. echo -e "displaying options messages."
  526. echo -e "Command: ./${gameservername}"
  527. echo -e ""
  528. (
  529. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  530. BASH_XTRACEFD="5"
  531. set -x
  532. core_getopt.sh
  533. )
  534. fn_test_result_pass
  535. echo -e "run order"
  536. echo -e "================="
  537. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  538. echo -e ""
  539. echo -e "1.3 - getopt with incorrect args"
  540. echo -e "================================="
  541. echo -e "Description:"
  542. echo -e "displaying options messages."
  543. echo -e "Command: ./${gameservername} abc123"
  544. echo -e ""
  545. getopt="abc123"
  546. (
  547. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  548. BASH_XTRACEFD="5"
  549. set -x
  550. core_getopt.sh
  551. )
  552. fn_test_result_fail
  553. echo -e "run order"
  554. echo -e "================="
  555. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  556. echo -e ""
  557. echo -e "2.0 - Installation"
  558. echo -e "=================================================================="
  559. echo -e ""
  560. echo -e "2.0 - install"
  561. echo -e "================================="
  562. echo -e "Description:"
  563. echo -e "install ${gamename} server."
  564. echo -e "Command: ./${gameservername} auto-install"
  565. (
  566. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  567. BASH_XTRACEFD="5"
  568. set -x
  569. fn_autoinstall
  570. )
  571. fn_test_result_pass
  572. echo -e "run order"
  573. echo -e "================="
  574. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  575. echo -e ""
  576. echo -e "3.0 - Start/Stop/Restart Tests"
  577. echo -e "=================================================================="
  578. echo -e ""
  579. echo -e "3.1 - start"
  580. echo -e "================================="
  581. echo -e "Description:"
  582. echo -e "start ${gamename} server."
  583. echo -e "Command: ./${gameservername} start"
  584. requiredstatus="OFFLINE"
  585. fn_setstatus
  586. (
  587. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  588. BASH_XTRACEFD="5"
  589. set -x
  590. command_start.sh
  591. )
  592. fn_test_result_pass
  593. echo -e "run order"
  594. echo -e "================="
  595. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  596. echo -e ""
  597. echo -e "3.2 - start - online"
  598. echo -e "================================="
  599. echo -e "Description:"
  600. echo -e "start ${gamename} server while already running."
  601. echo -e "Command: ./${gameservername} start"
  602. requiredstatus="ONLINE"
  603. fn_setstatus
  604. (
  605. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  606. BASH_XTRACEFD="5"
  607. set -x
  608. command_start.sh
  609. )
  610. fn_test_result_fail
  611. echo -e "run order"
  612. echo -e "================="
  613. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  614. echo -e ""
  615. echo -e "3.3 - start - updateonstart"
  616. echo -e "================================="
  617. echo -e "Description:"
  618. echo -e "will update server on start."
  619. echo -e "Command: ./${gameservername} start"
  620. requiredstatus="OFFLINE"
  621. fn_setstatus
  622. (
  623. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  624. BASH_XTRACEFD="5"
  625. set -x
  626. updateonstart="on";command_start.sh
  627. )
  628. fn_test_result_pass
  629. echo -e "run order"
  630. echo -e "================="
  631. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  632. echo -e ""
  633. echo -e "3.4 - stop"
  634. echo -e "================================="
  635. echo -e "Description:"
  636. echo -e "stop ${gamename} server."
  637. echo -e "Command: ./${gameservername} stop"
  638. requiredstatus="ONLINE"
  639. fn_setstatus
  640. (
  641. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  642. BASH_XTRACEFD="5"
  643. set -x
  644. command_stop.sh
  645. )
  646. fn_test_result_pass
  647. echo -e "run order"
  648. echo -e "================="
  649. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  650. echo -e ""
  651. echo -e "3.5 - stop - offline"
  652. echo -e "================================="
  653. echo -e "Description:"
  654. echo -e "stop ${gamename} server while already stopped."
  655. echo -e "Command: ./${gameservername} stop"
  656. requiredstatus="OFFLINE"
  657. fn_setstatus
  658. (
  659. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  660. BASH_XTRACEFD="5"
  661. set -x
  662. command_stop.sh
  663. )
  664. fn_test_result_fail
  665. echo -e "run order"
  666. echo -e "================="
  667. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  668. echo -e ""
  669. echo -e "3.6 - restart"
  670. echo -e "================================="
  671. echo -e "Description:"
  672. echo -e "restart ${gamename}."
  673. echo -e "Command: ./${gameservername} restart"
  674. requiredstatus="ONLINE"
  675. fn_setstatus
  676. (
  677. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  678. BASH_XTRACEFD="5"
  679. set -x
  680. command_restart.sh
  681. )
  682. fn_test_result_pass
  683. echo -e "run order"
  684. echo -e "================="
  685. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  686. echo -e ""
  687. echo -e "3.7 - restart - offline"
  688. echo -e "================================="
  689. echo -e "Description:"
  690. echo -e "restart ${gamename} while already stopped."
  691. echo -e "Command: ./${gameservername} restart"
  692. requiredstatus="OFFLINE"
  693. fn_setstatus
  694. (
  695. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  696. BASH_XTRACEFD="5"
  697. set -x
  698. command_restart.sh
  699. )
  700. fn_test_result_pass
  701. echo -e "run order"
  702. echo -e "================="
  703. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  704. echo -e ""
  705. echo -e "4.0 - Update Tests"
  706. echo -e "=================================================================="
  707. echo -e ""
  708. echo -e "4.1 - update"
  709. echo -e "================================="
  710. echo -e "Description:"
  711. echo -e "check for updates."
  712. echo -e "Command: ./${gameservername} update"
  713. requiredstatus="OFFLINE"
  714. fn_setstatus
  715. (
  716. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  717. BASH_XTRACEFD="5"
  718. set -x
  719. command_update.sh
  720. )
  721. fn_test_result_pass
  722. echo -e "run order"
  723. echo -e "================="
  724. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  725. echo -e ""
  726. echo -e "4.2 - update - change buildid"
  727. echo -e "================================="
  728. echo -e "Description:"
  729. echo -e "change the buildid tricking SteamCMD to update."
  730. echo -e "Command: ./jc2server update"
  731. requiredstatus="OFFLINE"
  732. fn_setstatus
  733. fn_print_info_nl "changed buildid to 0."
  734. sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf"
  735. (
  736. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  737. BASH_XTRACEFD="5"
  738. set -x
  739. command_update.sh
  740. )
  741. fn_test_result_pass
  742. echo -e "run order"
  743. echo -e "================="
  744. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  745. echo -e ""
  746. echo -e "4.3 - update - change buildid - online"
  747. echo -e "================================="
  748. echo -e "Description:"
  749. echo -e "change the buildid tricking SteamCMD to update server while already running."
  750. echo -e "Command: ./jc2server update"
  751. requiredstatus="ONLINE"
  752. fn_setstatus
  753. fn_print_info_nl "changed buildid to 0."
  754. sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf"
  755. (
  756. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  757. BASH_XTRACEFD="5"
  758. set -x
  759. command_update.sh
  760. )
  761. fn_test_result_pass
  762. echo -e "run order"
  763. echo -e "================="
  764. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  765. echo -e ""
  766. echo -e "4.4 - update - remove appmanifest file"
  767. echo -e "================================="
  768. echo -e "Description:"
  769. echo -e "removing appmanifest file will cause script to repair."
  770. echo -e "Command: ./jc2server update"
  771. requiredstatus="OFFLINE"
  772. fn_setstatus
  773. fn_print_info_nl "removed appmanifest_${appid}.acf."
  774. rm --verbose "${serverfiles:?}/steamapps/appmanifest_${appid}.acf"
  775. (
  776. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  777. BASH_XTRACEFD="5"
  778. set -x
  779. command_update.sh
  780. )
  781. fn_test_result_pass
  782. echo -e "run order"
  783. echo -e "================="
  784. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  785. echo -e ""
  786. echo -e "4.5 - force-update"
  787. echo -e "================================="
  788. echo -e "Description:"
  789. echo -e "force-update bypassing update check."
  790. echo -e "Command: ./jc2server force-update"
  791. requiredstatus="OFFLINE"
  792. fn_setstatus
  793. (
  794. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  795. BASH_XTRACEFD="5"
  796. set -x
  797. forceupdate=1;command_update.sh
  798. )
  799. fn_test_result_pass
  800. echo -e "run order"
  801. echo -e "================="
  802. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  803. echo -e ""
  804. echo -e "4.6 - force-update - online"
  805. echo -e "================================="
  806. echo -e "Description:"
  807. echo -e "force-update bypassing update check server while already running."
  808. echo -e "Command: ./jc2server force-update"
  809. requiredstatus="ONLINE"
  810. fn_setstatus
  811. (
  812. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  813. BASH_XTRACEFD="5"
  814. set -x
  815. forceupdate=1;command_update.sh
  816. )
  817. fn_test_result_pass
  818. echo -e "run order"
  819. echo -e "================="
  820. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  821. echo -e ""
  822. echo -e "4.7 - validate"
  823. echo -e "================================="
  824. echo -e "Description:"
  825. echo -e "validate server files."
  826. echo -e "Command: ./jc2server validate"
  827. requiredstatus="OFFLINE"
  828. fn_setstatus
  829. (
  830. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  831. BASH_XTRACEFD="5"
  832. set -x
  833. command_validate.sh
  834. )
  835. fn_test_result_pass
  836. echo -e "run order"
  837. echo -e "================="
  838. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  839. echo -e ""
  840. echo -e "4.8 - validate - online"
  841. echo -e "================================="
  842. echo -e "Description:"
  843. echo -e "validate server files while server already running."
  844. echo -e ""
  845. echo -e "Command: ./jc2server validate"
  846. requiredstatus="ONLINE"
  847. fn_setstatus
  848. (
  849. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  850. BASH_XTRACEFD="5"
  851. set -x
  852. command_validate.sh
  853. )
  854. fn_test_result_pass
  855. echo -e "run order"
  856. echo -e "================="
  857. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  858. echo -e ""
  859. echo -e "Inserting IP address"
  860. echo -e "================================="
  861. echo -e "Description:"
  862. echo -e "Inserting Travis IP in to config."
  863. echo -e "Allows monitor to work"
  864. if [ "$(ip -o -4 addr|grep eth0)" ]; then
  865. travisip=$(ip -o -4 addr | grep eth0 | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | grep -v 127.0.0)
  866. else
  867. travisip=$(ip -o -4 addr | grep ens | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -v 127.0.0)
  868. fi
  869. sed -i "/BindIP/c\BindIP = \"${travisip}\"," "${serverfiles}/config.lua"
  870. echo -e "IP: ${travisip}"
  871. echo -e ""
  872. echo -e "5.0 - Monitor Tests"
  873. echo -e "=================================================================="
  874. echo -e ""
  875. info_config.sh
  876. echo -e "Server IP - Port: ${ip}:${port}"
  877. echo -e "Server IP - Query Port: ${ip}:${queryport}"
  878. echo -e ""
  879. echo -e "5.1 - monitor - online"
  880. echo -e "================================="
  881. echo -e "Description:"
  882. echo -e "run monitor server while already running."
  883. echo -e "Command: ./${gameservername} monitor"
  884. requiredstatus="ONLINE"
  885. fn_setstatus
  886. (
  887. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  888. BASH_XTRACEFD="5"
  889. set -x
  890. command_monitor.sh
  891. )
  892. fn_test_result_pass
  893. echo -e "run order"
  894. echo -e "================="
  895. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  896. echo -e ""
  897. echo -e "5.2 - monitor - offline - with lockfile"
  898. echo -e "================================="
  899. echo -e "Description:"
  900. echo -e "run monitor while server is offline with lockfile."
  901. echo -e "Command: ./${gameservername} monitor"
  902. requiredstatus="OFFLINE"
  903. fn_setstatus
  904. fn_print_info_nl "creating lockfile."
  905. date '+%s' > "${lockdir}/${selfname}.lock"
  906. (
  907. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  908. BASH_XTRACEFD="5"
  909. set -x
  910. command_monitor.sh
  911. )
  912. fn_test_result_pass
  913. echo -e "run order"
  914. echo -e "================="
  915. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  916. echo -e ""
  917. echo -e "5.3 - monitor - offline - no lockfile"
  918. echo -e "================================="
  919. echo -e "Description:"
  920. echo -e "run monitor while server is offline with no lockfile."
  921. echo -e "Command: ./${gameservername} monitor"
  922. requiredstatus="OFFLINE"
  923. fn_setstatus
  924. (
  925. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  926. BASH_XTRACEFD="5"
  927. set -x
  928. command_monitor.sh
  929. )
  930. fn_test_result_fail
  931. echo -e "run order"
  932. echo -e "================="
  933. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  934. echo -e ""
  935. echo -e "5.4 - test-alert"
  936. echo -e "================================="
  937. echo -e "Description:"
  938. echo -e "run monitor while server is offline with no lockfile."
  939. echo -e "Command: ./${gameservername} test-alert"
  940. requiredstatus="OFFLINE"
  941. fn_setstatus
  942. cp "${servercfgfullpath}" "config.lua"
  943. sed -i 's/[0-9]\+/0/' "${servercfgfullpath}"
  944. (
  945. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  946. BASH_XTRACEFD="5"
  947. set -x
  948. command_test_alert.sh
  949. )
  950. fn_test_result_fail
  951. echo -e "run order"
  952. echo -e "================="
  953. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  954. echo -e ""
  955. fn_print_info_nl "Re-generating ${servercfg}."
  956. cp -v "config.lua" "${servercfgfullpath}"
  957. echo -e "================================="
  958. echo -e ""
  959. echo -e "6.0 - Details Tests"
  960. echo -e "=================================================================="
  961. echo -e ""
  962. echo -e "6.1 - details"
  963. echo -e "================================="
  964. echo -e "Description:"
  965. echo -e "display details."
  966. echo -e "Command: ./${gameservername} details"
  967. requiredstatus="ONLINE"
  968. fn_setstatus
  969. (
  970. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  971. BASH_XTRACEFD="5"
  972. set -x
  973. command_details.sh
  974. )
  975. fn_test_result_pass
  976. echo -e "run order"
  977. echo -e "================="
  978. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  979. echo -e ""
  980. echo -e "6.2 - postdetails"
  981. echo -e "================================="
  982. echo -e "Description:"
  983. echo -e "post details."
  984. echo -e "Command: ./${gameservername} postdetails"
  985. requiredstatus="ONLINE"
  986. fn_setstatus
  987. (
  988. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  989. BASH_XTRACEFD="5"
  990. set -x
  991. command_postdetails.sh
  992. )
  993. fn_test_result_pass
  994. echo -e "run order"
  995. echo -e "================="
  996. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  997. echo -e ""
  998. echo -e "7.0 - Backup Tests"
  999. echo -e "=================================================================="
  1000. echo -e ""
  1001. echo -e "7.1 - backup"
  1002. echo -e "================================="
  1003. echo -e "Description:"
  1004. echo -e "run a backup."
  1005. echo -e "Command: ./${gameservername} backup"
  1006. requiredstatus="ONLINE"
  1007. fn_setstatus
  1008. echo -e "test de-activated until issue #1839 fixed"
  1009. #(command_backup.sh)
  1010. fn_test_result_pass
  1011. echo -e "run order"
  1012. echo -e "================="
  1013. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  1014. echo -e ""
  1015. echo -e "8.0 - Development Tools Tests"
  1016. echo -e "=================================================================="
  1017. echo -e ""
  1018. echo -e "8.1 - dev - detect glibc"
  1019. echo -e "================================="
  1020. echo -e "Description:"
  1021. echo -e "detect glibc."
  1022. echo -e "Command: ./${gameservername} detect-glibc"
  1023. requiredstatus="ONLINE"
  1024. fn_setstatus
  1025. (
  1026. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  1027. BASH_XTRACEFD="5"
  1028. set -x
  1029. command_dev_detect_glibc.sh
  1030. )
  1031. fn_test_result_pass
  1032. echo -e "run order"
  1033. echo -e "================="
  1034. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  1035. echo -e ""
  1036. echo -e "8.2 - dev - detect ldd"
  1037. echo -e "================================="
  1038. echo -e "Description:"
  1039. echo -e "detect ldd."
  1040. echo -e "Command: ./${gameservername} detect-ldd"
  1041. requiredstatus="ONLINE"
  1042. fn_setstatus
  1043. (
  1044. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  1045. BASH_XTRACEFD="5"
  1046. set -x
  1047. command_dev_detect_ldd.sh
  1048. )
  1049. fn_test_result_pass
  1050. echo -e "run order"
  1051. echo -e "================="
  1052. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  1053. echo -e ""
  1054. echo -e "8.3 - dev - detect deps"
  1055. echo -e "================================="
  1056. echo -e "Description:"
  1057. echo -e "detect dependencies."
  1058. echo -e "Command: ./${gameservername} detect-deps"
  1059. requiredstatus="ONLINE"
  1060. fn_setstatus
  1061. (
  1062. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  1063. BASH_XTRACEFD="5"
  1064. set -x
  1065. command_dev_detect_deps.sh
  1066. )
  1067. fn_test_result_pass
  1068. echo -e "run order"
  1069. echo -e "================="
  1070. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  1071. echo -e ""
  1072. echo -e "8.4 - dev - query-raw"
  1073. echo -e "================================="
  1074. echo -e "Description:"
  1075. echo -e "raw query output."
  1076. echo -e "Command: ./${gameservername} query-raw"
  1077. requiredstatus="ONLINE"
  1078. fn_setstatus
  1079. (
  1080. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  1081. BASH_XTRACEFD="5"
  1082. set -x
  1083. command_dev_query_raw.sh
  1084. )
  1085. fn_test_result_na
  1086. echo -e "run order"
  1087. echo -e "================="
  1088. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  1089. echo -e ""
  1090. echo -e "================================="
  1091. echo -e "Server Tests - Complete!"
  1092. echo -e "Using: ${gamename}"
  1093. echo -e "================================="
  1094. requiredstatus="OFFLINE"
  1095. fn_setstatus
  1096. if [ ! -v TRAVIS ]; then
  1097. fn_print_info "Tidying up directories."
  1098. rm -rfv "${serverfiles:?}"
  1099. fi
  1100. core_exit.sh