tests_jc2server.sh 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178
  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. echo -e "Server IP - Port: ${ip}:${port}"
  876. echo -e "Server IP - Query Port: ${ip}:${queryport}"
  877. echo -e ""
  878. echo -e "5.1 - monitor - online"
  879. echo -e "================================="
  880. echo -e "Description:"
  881. echo -e "run monitor server while already running."
  882. echo -e "Command: ./${gameservername} monitor"
  883. requiredstatus="ONLINE"
  884. fn_setstatus
  885. (
  886. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  887. BASH_XTRACEFD="5"
  888. set -x
  889. command_monitor.sh
  890. )
  891. fn_test_result_pass
  892. echo -e "run order"
  893. echo -e "================="
  894. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  895. echo -e ""
  896. echo -e "5.2 - monitor - offline - with lockfile"
  897. echo -e "================================="
  898. echo -e "Description:"
  899. echo -e "run monitor while server is offline with lockfile."
  900. echo -e "Command: ./${gameservername} monitor"
  901. requiredstatus="OFFLINE"
  902. fn_setstatus
  903. fn_print_info_nl "creating lockfile."
  904. date '+%s' > "${lockdir}/${selfname}.lock"
  905. (
  906. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  907. BASH_XTRACEFD="5"
  908. set -x
  909. command_monitor.sh
  910. )
  911. fn_test_result_pass
  912. echo -e "run order"
  913. echo -e "================="
  914. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  915. echo -e ""
  916. echo -e "5.3 - monitor - offline - no lockfile"
  917. echo -e "================================="
  918. echo -e "Description:"
  919. echo -e "run monitor while server is offline with no lockfile."
  920. echo -e "Command: ./${gameservername} monitor"
  921. requiredstatus="OFFLINE"
  922. fn_setstatus
  923. (
  924. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  925. BASH_XTRACEFD="5"
  926. set -x
  927. command_monitor.sh
  928. )
  929. fn_test_result_fail
  930. echo -e "run order"
  931. echo -e "================="
  932. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  933. echo -e ""
  934. echo -e "5.4 - test-alert"
  935. echo -e "================================="
  936. echo -e "Description:"
  937. echo -e "run monitor while server is offline with no lockfile."
  938. echo -e "Command: ./${gameservername} test-alert"
  939. requiredstatus="OFFLINE"
  940. fn_setstatus
  941. cp "${servercfgfullpath}" "config.lua"
  942. sed -i 's/[0-9]\+/0/' "${servercfgfullpath}"
  943. (
  944. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  945. BASH_XTRACEFD="5"
  946. set -x
  947. command_test_alert.sh
  948. )
  949. fn_test_result_fail
  950. echo -e "run order"
  951. echo -e "================="
  952. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  953. echo -e ""
  954. fn_print_info_nl "Re-generating ${servercfg}."
  955. cp -v "config.lua" "${servercfgfullpath}"
  956. echo -e "================================="
  957. echo -e ""
  958. echo -e "6.0 - Details Tests"
  959. echo -e "=================================================================="
  960. echo -e ""
  961. echo -e "6.1 - details"
  962. echo -e "================================="
  963. echo -e "Description:"
  964. echo -e "display details."
  965. echo -e "Command: ./${gameservername} details"
  966. requiredstatus="ONLINE"
  967. fn_setstatus
  968. (
  969. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  970. BASH_XTRACEFD="5"
  971. set -x
  972. command_details.sh
  973. )
  974. fn_test_result_pass
  975. echo -e "run order"
  976. echo -e "================="
  977. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  978. echo -e ""
  979. echo -e "6.2 - postdetails"
  980. echo -e "================================="
  981. echo -e "Description:"
  982. echo -e "post details."
  983. echo -e "Command: ./${gameservername} postdetails"
  984. requiredstatus="ONLINE"
  985. fn_setstatus
  986. (
  987. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  988. BASH_XTRACEFD="5"
  989. set -x
  990. command_postdetails.sh
  991. )
  992. fn_test_result_pass
  993. echo -e "run order"
  994. echo -e "================="
  995. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  996. echo -e ""
  997. echo -e "7.0 - Backup Tests"
  998. echo -e "=================================================================="
  999. echo -e ""
  1000. echo -e "7.1 - backup"
  1001. echo -e "================================="
  1002. echo -e "Description:"
  1003. echo -e "run a backup."
  1004. echo -e "Command: ./${gameservername} backup"
  1005. requiredstatus="ONLINE"
  1006. fn_setstatus
  1007. echo -e "test de-activated until issue #1839 fixed"
  1008. #(command_backup.sh)
  1009. fn_test_result_pass
  1010. echo -e "run order"
  1011. echo -e "================="
  1012. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  1013. echo -e ""
  1014. echo -e "8.0 - Development Tools Tests"
  1015. echo -e "=================================================================="
  1016. echo -e ""
  1017. echo -e "8.1 - dev - detect glibc"
  1018. echo -e "================================="
  1019. echo -e "Description:"
  1020. echo -e "detect glibc."
  1021. echo -e "Command: ./${gameservername} detect-glibc"
  1022. requiredstatus="ONLINE"
  1023. fn_setstatus
  1024. (
  1025. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  1026. BASH_XTRACEFD="5"
  1027. set -x
  1028. command_dev_detect_glibc.sh
  1029. )
  1030. fn_test_result_pass
  1031. echo -e "run order"
  1032. echo -e "================="
  1033. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  1034. echo -e ""
  1035. echo -e "8.2 - dev - detect ldd"
  1036. echo -e "================================="
  1037. echo -e "Description:"
  1038. echo -e "detect ldd."
  1039. echo -e "Command: ./${gameservername} detect-ldd"
  1040. requiredstatus="ONLINE"
  1041. fn_setstatus
  1042. (
  1043. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  1044. BASH_XTRACEFD="5"
  1045. set -x
  1046. command_dev_detect_ldd.sh
  1047. )
  1048. fn_test_result_pass
  1049. echo -e "run order"
  1050. echo -e "================="
  1051. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  1052. echo -e ""
  1053. echo -e "8.3 - dev - detect deps"
  1054. echo -e "================================="
  1055. echo -e "Description:"
  1056. echo -e "detect dependencies."
  1057. echo -e "Command: ./${gameservername} detect-deps"
  1058. requiredstatus="ONLINE"
  1059. fn_setstatus
  1060. (
  1061. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  1062. BASH_XTRACEFD="5"
  1063. set -x
  1064. command_dev_detect_deps.sh
  1065. )
  1066. fn_test_result_pass
  1067. echo -e "run order"
  1068. echo -e "================="
  1069. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  1070. echo -e ""
  1071. echo -e "8.4 - dev - query-raw"
  1072. echo -e "================================="
  1073. echo -e "Description:"
  1074. echo -e "raw query output."
  1075. echo -e "Command: ./${gameservername} query-raw"
  1076. requiredstatus="ONLINE"
  1077. fn_setstatus
  1078. (
  1079. exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log"
  1080. BASH_XTRACEFD="5"
  1081. set -x
  1082. command_dev_query_raw.sh
  1083. )
  1084. fn_test_result_na
  1085. echo -e "run order"
  1086. echo -e "================="
  1087. grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g'
  1088. echo -e ""
  1089. echo -e "================================="
  1090. echo -e "Server Tests - Complete!"
  1091. echo -e "Using: ${gamename}"
  1092. echo -e "================================="
  1093. requiredstatus="OFFLINE"
  1094. fn_setstatus
  1095. if [ ! -v TRAVIS ]; then
  1096. fn_print_info "Tidying up directories."
  1097. rm -rfv "${serverfiles:?}"
  1098. fi
  1099. core_exit.sh