command_details.sh 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. #!/bin/bash
  2. # LGSM command_details.sh function
  3. # Author: Daniel Gibbs
  4. # Contributor: UltimateByte
  5. # Website: https://gameservermanagers.com
  6. # Description: Displays server information.
  7. local commandname="DETAILS"
  8. local commandaction="Details"
  9. local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  10. # Standard Details
  11. # This applies to all engines
  12. fn_details_os(){
  13. #
  14. # Distro Details
  15. # =====================================
  16. # Distro: Ubuntu 14.04.4 LTS
  17. # Arch: x86_64
  18. # Kernel: 3.13.0-79-generic
  19. # Hostname: hostname
  20. # tmux: tmux 1.8
  21. # GLIBC: 2.19
  22. echo -e ""
  23. echo -e "${lightyellow}Distro Details${default}"
  24. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  25. {
  26. echo -e "${blue}Distro:\t${default}${distroname}"
  27. echo -e "${blue}Arch:\t${default}${arch}"
  28. echo -e "${blue}Kernel:\t${default}${kernel}"
  29. echo -e "${blue}Hostname:\t${default}$HOSTNAME"
  30. echo -e "${blue}tmux:\t${default}${tmuxv}"
  31. echo -e "${blue}GLIBC:\t${default}${glibcversion}"
  32. } | column -s $'\t' -t
  33. }
  34. fn_details_performance(){
  35. #
  36. # Performance
  37. # =====================================
  38. # Uptime: 55d, 3h, 38m
  39. # Avg Load: 1.00, 1.01, 0.78
  40. #
  41. # Mem: total used free cached
  42. # Physical: 741M 656M 85M 256M
  43. # Swap: 0B 0B 0B
  44. echo -e ""
  45. echo -e "${lightyellow}Performance${default}"
  46. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  47. {
  48. echo -e "${blue}Uptime:\t${default}${days}d, ${hours}h, ${minutes}m"
  49. echo -e "${blue}Avg Load:\t${default}${load}"
  50. } | column -s $'\t' -t
  51. echo -e ""
  52. {
  53. echo -e "${blue}Mem:\t${blue}total\t used\t free\t cached${default}"
  54. echo -e "${blue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}${default}"
  55. echo -e "${blue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}"
  56. } | column -s $'\t' -t
  57. }
  58. fn_details_disk(){
  59. #
  60. # Storage
  61. # =====================================
  62. # Filesystem: /dev/disk/by-uuid/320c8edd-a2ce-4a23-8c9d-e00a7af2d6ff
  63. # Total: 15G
  64. # Used: 8.4G
  65. # Available: 5.7G
  66. # LGSM Total: 1G
  67. # Serverfiles: 961M
  68. # Backups: 2G
  69. echo -e ""
  70. echo -e "${lightyellow}Storage${default}"
  71. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  72. {
  73. echo -e "${blue}Filesystem:\t${default}${filesystem}"
  74. echo -e "${blue}Total:\t${default}${totalspace}"
  75. echo -e "${blue}Used:\t${default}${usedspace}"
  76. echo -e "${blue}Available:\t${default}${availspace}"
  77. echo -e "${blue}LGSM Total:\t${default}${rootdirdu}"
  78. echo -e "${blue}Serverfiles:\t${default}${filesdirdu}"
  79. if [ -d "${backupdir}" ]; then
  80. echo -e "${blue}Backups:\t${default}${backupdirdu}"
  81. fi
  82. } | column -s $'\t' -t
  83. }
  84. fn_details_gameserver(){
  85. #
  86. # Quake Live Server Details
  87. # =====================================
  88. # Server name: ql-server
  89. # Server IP: 1.2.3.4:27960
  90. # RCON password: CHANGE_ME
  91. # Server password: NOT SET
  92. # Slots: 16
  93. # Status: OFFLINE
  94. echo -e ""
  95. echo -e "${lightgreen}${gamename} Server Details${default}"
  96. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  97. {
  98. # Server name
  99. if [ -n "${servername}" ]; then
  100. echo -e "${blue}Server name:\t${default}${servername}"
  101. fi
  102. # Server ip
  103. echo -e "${blue}Server IP:\t${default}${ip}:${port}"
  104. # Server password
  105. if [ -n "${serverpassword}" ]; then
  106. echo -e "${blue}Server password:\t${default}${serverpassword}"
  107. fi
  108. # RCON password
  109. if [ -n "${rconpassword}" ]; then
  110. echo -e "${blue}RCON password:\t${default}${rconpassword}"
  111. fi
  112. # Admin password
  113. if [ -n "${adminpassword}" ]; then
  114. echo -e "${blue}Admin password:\t${default}${adminpassword}"
  115. fi
  116. # Stats password (Quake Live)
  117. if [ -n "${statspassword}" ]; then
  118. echo -e "${blue}Stats password:\t${default}${statspassword}"
  119. fi
  120. # Slots
  121. if [ -n "${slots}" ]; then
  122. echo -e "${blue}Slots:\t${default}${slots}"
  123. fi
  124. # Game mode
  125. if [ -n "${gamemode}" ]; then
  126. echo -e "${blue}Game mode:\t${default}${gamemode}"
  127. fi
  128. # Game world
  129. if [ -n "${gameworld}" ]; then
  130. echo -e "${blue}Game world:\t${default}${gameworld}"
  131. fi
  132. # Tick rate
  133. if [ -n "${tickrate}" ]; then
  134. echo -e "${blue}Tick rate:\t${default}${tickrate}"
  135. fi
  136. # TeamSpeak dbplugin
  137. if [ -n "${dbplugin}" ]; then
  138. echo -e "${blue}dbplugin:\t${default}${dbplugin}"
  139. fi
  140. # Online status
  141. if [ "${status}" == "0" ]; then
  142. echo -e "${blue}Status:\t${red}OFFLINE${default}"
  143. else
  144. echo -e "${blue}Status:\t${green}ONLINE${default}"
  145. fi
  146. } | column -s $'\t' -t
  147. echo -e ""
  148. }
  149. fn_details_script(){
  150. #
  151. # qlserver Script Details
  152. # =====================================
  153. # Service name: ql-server
  154. # qlserver version: 150316
  155. # User: lgsm
  156. # Email alert: off
  157. # Update on start: off
  158. # Location: /home/lgsm/qlserver
  159. # Config file: /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg
  160. echo -e "${lightgreen}${selfname} Script Details${default}"
  161. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  162. {
  163. # Service name
  164. echo -e "${blue}Service name:\t${default}${servicename}"
  165. # Script version
  166. if [ -n "${version}" ]; then
  167. echo -e "${blue}${selfname} version:\t${default}${version}"
  168. fi
  169. # User
  170. echo -e "${blue}User:\t${default}$(whoami)"
  171. # GLIBC required
  172. if [ -n "${glibcrequired}" ]; then
  173. if [ "${glibcrequired}" == "NOT REQUIRED" ]; then
  174. :
  175. elif [ "${glibcrequired}" == "UNKNOWN" ]; then
  176. echo -e "${blue}GLIBC required:\t${red}${glibcrequired}"
  177. elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then
  178. if [ "${glibcfix}" == "yes" ]; then
  179. echo -e "${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${green}Using GLIBC fix${default})"
  180. else
  181. echo -e "${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${red}GLIBC version too old${default})"
  182. fi
  183. else
  184. echo -e "${blue}GLIBC required:\t${green}${glibcrequired}${default}"
  185. fi
  186. fi
  187. # Email alert
  188. echo -e "${blue}Email alert:\t${default}${emailalert}"
  189. # Pushbullet alert
  190. echo -e "${blue}Pushbullet alert:\t${default}${pushbulletalert}"
  191. # Update on start
  192. echo -e "${blue}Update on start:\t${default}${updateonstart}"
  193. # Script location
  194. echo -e "${blue}Location:\t${default}${rootdir}"
  195. # Config file location
  196. if [ -n "${servercfgfullpath}" ]; then
  197. if [ -f "${servercfgfullpath}" ]; then
  198. echo -e "${blue}Config file:\t${default}${servercfgfullpath}"
  199. else
  200. echo -e "${blue}Config file:\t${default}${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})"
  201. fi
  202. fi
  203. # Network config file location (ARMA 3)
  204. if [ -n "${networkcfgfullpath}" ]; then
  205. echo -e "${blue}Network config file:\t${default}${networkcfgfullpath}"
  206. fi
  207. } | column -s $'\t' -t
  208. }
  209. fn_details_backup(){
  210. #
  211. # Backups
  212. # =====================================
  213. # No. of backups: 1
  214. # Latest backup:
  215. # date: Fri May 6 18:34:19 UTC 2016
  216. # file: /home/lgsm/qlserver/backups/ql-server-2016-05-06-183239.tar.gz
  217. # size: 945M
  218. echo -e ""
  219. echo -e "${lightgreen}Backups${default}"
  220. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  221. if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
  222. echo -e "No Backups created"
  223. else
  224. {
  225. echo -e "${blue}No. of backups:\t${default}${backupcount}"
  226. echo -e "${blue}Latest backup:${default}"
  227. echo -e "${blue} date:\t${default}${lastbackupdate}"
  228. echo -e "${blue} file:\t${default}${lastbackup}"
  229. echo -e "${blue} size:\t${default}${lastbackupsize}"
  230. } | column -s $'\t' -t
  231. fi
  232. }
  233. fn_details_commandlineparms(){
  234. #
  235. # Command-line Parameters
  236. # =====================================
  237. # ./run_server_x86.sh +set net_strict 1
  238. echo -e ""
  239. echo -e "${lightgreen}Command-line Parameters${default}"
  240. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  241. echo -e "${executable} ${parms}"
  242. }
  243. fn_details_ports(){
  244. # Ports
  245. # =====================================
  246. # Change ports by editing the parameters in:
  247. # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg
  248. echo -e ""
  249. echo -e "${lightgreen}Ports${default}"
  250. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  251. echo -e "Change ports by editing the parameters in:"
  252. parmslocation="${red}UNKNOWN${default}"
  253. # engines that require editing in the config file
  254. local ports_edit_array=( "avalanche" "dontstarve" "idtech3" "lwjgl2" "projectzomboid" "realvirtuality" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "TeamSpeak 3" "Mumble" "7 Days To Die" )
  255. for port_edit in "${ports_edit_array[@]}"
  256. do
  257. if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
  258. parmslocation="${servercfgfullpath}"
  259. fi
  260. done
  261. # engines that require editing in the script file
  262. local ports_edit_array=( "starbound" "spark" "source" "goldsource" "Rust" "Hurtworld" "unreal4")
  263. for port_edit in "${ports_edit_array[@]}"
  264. do
  265. if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
  266. parmslocation="${selfname}"
  267. fi
  268. done
  269. echo -e "${parmslocation}"
  270. echo -e ""
  271. echo -e "Useful port diagnostic command:"
  272. }
  273. fn_details_statusbottom(){
  274. echo -e ""
  275. if [ "${status}" == "0" ]; then
  276. echo -e "${blue}Status:\t${red}OFFLINE${default}"
  277. else
  278. echo -e "${blue}Status:\t${green}ONLINE${default}"
  279. fi
  280. echo -e ""
  281. }
  282. # Engine Specific details
  283. fn_details_avalanche(){
  284. echo -e "netstat -atunp | grep Jcmp-Server"
  285. echo -e ""
  286. {
  287. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  288. echo -e "> Game\tINBOUND\t${port}\tudp"
  289. } | column -s $'\t' -t
  290. }
  291. fn_details_dontstarve(){
  292. echo -e "netstat -atunp | grep dontstarve"
  293. echo -e ""
  294. {
  295. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  296. echo -e "> Game\tINBOUND\t${port}\tudp"
  297. } | column -s $'\t' -t
  298. }
  299. fn_details_minecraft(){
  300. echo -e "netstat -atunp | grep java"
  301. echo -e ""
  302. {
  303. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  304. echo -e "> Game\tINBOUND\t${port}\tudp"
  305. } | column -s $'\t' -t
  306. }
  307. fn_details_projectzomboid(){
  308. echo -e "netstat -atunp | grep java"
  309. echo -e ""
  310. {
  311. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  312. echo -e "> Game\tINBOUND\t${port}\tudp"
  313. } | column -s $'\t' -t
  314. }
  315. fn_details_realvirtuality(){
  316. echo -e "netstat -atunp | grep arma3server"
  317. echo -e ""
  318. if [ -z "${port}" ]||[ -z "${queryport}" ]||[ -z "${masterport}" ]; then
  319. echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}."
  320. echo -e ""
  321. fi
  322. {
  323. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  324. echo -e "> Game\tINBOUND\t${port}\tudp"
  325. echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp"
  326. echo -e "> Steam: Master traffic\tINBOUND\t${masterport}\tudp"
  327. } | column -s $'\t' -t
  328. }
  329. fn_details_idtech3(){
  330. echo -e "netstat -atunp | grep qzeroded"
  331. echo -e ""
  332. if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then
  333. echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}."
  334. echo -e ""
  335. fi
  336. {
  337. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  338. echo -e "> Game\tINBOUND\t${port}\tudp"
  339. echo -e "> Rcon\tINBOUND\t${rconport}\tudp"
  340. echo -e "> Stats\tINBOUND\t${statsport}\tudp"
  341. } | column -s $'\t' -t
  342. }
  343. fn_details_seriousengine35(){
  344. echo -e "netstat -atunp | grep Sam3_Dedicate"
  345. echo -e ""
  346. {
  347. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  348. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp"
  349. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  350. } | column -s $'\t' -t
  351. }
  352. fn_details_source(){
  353. echo -e "netstat -atunp | grep srcds_linux"
  354. echo -e ""
  355. {
  356. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  357. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  358. if [ -n "${sourcetvport}" ]; then
  359. echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp"
  360. fi
  361. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  362. } | column -s $'\t' -t
  363. }
  364. fn_details_spark(){
  365. echo -e "netstat -atunp | grep server_linux3"
  366. echo -e ""
  367. {
  368. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  369. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  370. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  371. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  372. } | column -s $'\t' -t
  373. echo -e ""
  374. echo -e "${lightgreen}${servername} WebAdmin${default}"
  375. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  376. {
  377. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}/index.html"
  378. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  379. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  380. } | column -s $'\t' -t
  381. }
  382. fn_details_starbound(){
  383. echo -e "netstat -atunp | grep starbound"
  384. echo -e ""
  385. {
  386. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  387. echo -e "> Game\tINBOUND\t${port}\ttcp"
  388. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  389. echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
  390. } | column -s $'\t' -t
  391. }
  392. fn_details_teamspeak3(){
  393. echo -e "netstat -atunp | grep ts3server"
  394. echo -e ""
  395. {
  396. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  397. echo -e "> Voice\tINBOUND\t${port}\tudp"
  398. echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp"
  399. echo -e "> File transfer\tINBOUND\t${fileport}\ttcp"
  400. } | column -s $'\t' -t
  401. }
  402. fn_details_mumble(){
  403. echo -e "netstat -atunp | grep murmur"
  404. echo -e ""
  405. {
  406. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  407. echo -e "> Voice\tINBOUND\t${port}\tudp"
  408. echo -e "> ServerQuery\tINBOUND\t${port}\ttcp"
  409. } | column -s $'\t' -t
  410. }
  411. fn_details_teeworlds(){
  412. echo -e "netstat -atunp | grep teeworlds_srv"
  413. echo -e ""
  414. {
  415. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  416. echo -e "> Game\tINBOUND\t${port}\ttcp"
  417. } | column -s $'\t' -t
  418. }
  419. fn_details_terraria(){
  420. echo -e "netstat -atunp | grep TerrariaServer"
  421. echo -e ""
  422. {
  423. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  424. echo -e "> Game\tINBOUND\t${port}\ttcp"
  425. } | column -s $'\t' -t
  426. }
  427. fn_details_sdtd(){
  428. echo -e "netstat -atunp | grep 7DaysToDie"
  429. echo -e ""
  430. {
  431. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  432. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  433. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  434. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  435. echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
  436. } | column -s $'\t' -t
  437. echo -e ""
  438. echo -e "${lightgreen}${servername} WebAdmin${default}"
  439. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  440. {
  441. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  442. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  443. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  444. } | column -s $'\t' -t
  445. echo -e ""
  446. echo -e "${lightgreen}${servername} Telnet${default}"
  447. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  448. {
  449. echo -e "${blue}Telnet enabled:\t${default}${telnetenabled}"
  450. echo -e "${blue}Telnet address:\t${default}${ip} ${telnetport}"
  451. echo -e "${blue}Telnet password:\t${default}${telnetpass}"
  452. } | column -s $'\t' -t
  453. }
  454. fn_details_hurtworld(){
  455. echo -e "netstat -atunp | grep Hurtworld"
  456. echo -e ""
  457. {
  458. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  459. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  460. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  461. } | column -s $'\t' -t
  462. }
  463. fn_details_rust(){
  464. echo -e "netstat -atunp | grep Rust"
  465. echo -e ""
  466. {
  467. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  468. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  469. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  470. } | column -s $'\t' -t
  471. }
  472. fn_details_unreal(){
  473. echo -e "netstat -atunp | grep ucc-bin"
  474. echo -e ""
  475. {
  476. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  477. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  478. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  479. if [ "${engine}" == "unreal" ]; then
  480. echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp"
  481. fi
  482. if [ "${engine}" != "unreal" ] && [ "${appid}" != "223250" ]; then
  483. echo -e "> GameSpy query\tINBOUND\t${gsqueryport}\tudp\tOldQueryPortNumber=${gsqueryport}"
  484. fi
  485. if [ "${appid}" == "215360" ]; then
  486. echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp"
  487. else
  488. echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp"
  489. fi
  490. if [ "${appid}" ]; then
  491. if [ "${appid}" == "223250" ]; then
  492. echo -e "< Steam\tOUTBOUND\t20610\tudp"
  493. else
  494. echo -e "< Steam\tOUTBOUND\t20660\tudp"
  495. fi
  496. fi
  497. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  498. } | column -s $'\t' -t
  499. echo -e ""
  500. echo -e "${lightgreen}${servername} WebAdmin${default}"
  501. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  502. {
  503. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  504. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  505. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  506. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  507. } | column -s $'\t' -t
  508. }
  509. fn_details_ark(){
  510. echo -e "netstat -atunp | grep ShooterGame"
  511. echo -e ""
  512. {
  513. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  514. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  515. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  516. } | column -s $'\t' -t
  517. }
  518. # Run checks and gathers details to display.
  519. check.sh
  520. info_config.sh
  521. info_distro.sh
  522. info_glibc.sh
  523. info_parms.sh
  524. fn_details_os
  525. fn_details_performance
  526. fn_details_disk
  527. fn_details_gameserver
  528. fn_details_script
  529. fn_details_backup
  530. # Some game servers do not have parms.
  531. if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${engine}" != "avalanche" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]; then
  532. fn_parms
  533. fn_details_commandlineparms
  534. fi
  535. fn_details_ports
  536. # Display details depending on game or engine.
  537. if [ "${engine}" == "avalanche" ]; then
  538. fn_details_avalanche
  539. elif [ "${engine}" == "dontstarve" ]; then
  540. fn_details_dontstarve
  541. elif [ "${engine}" == "lwjgl2" ]; then
  542. fn_details_minecraft
  543. elif [ "${engine}" == "projectzomboid" ]; then
  544. fn_details_projectzomboid
  545. elif [ "${engine}" == "idtech3" ]; then
  546. fn_details_idtech3
  547. elif [ "${engine}" == "realvirtuality" ]; then
  548. fn_details_realvirtuality
  549. elif [ "${engine}" == "seriousengine35" ]; then
  550. fn_details_seriousengine35
  551. elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
  552. fn_details_source
  553. elif [ "${engine}" == "spark" ]; then
  554. fn_details_spark
  555. elif [ "${engine}" == "starbound" ]; then
  556. fn_details_starbound
  557. elif [ "${engine}" == "teeworlds" ]; then
  558. fn_details_teeworlds
  559. elif [ "${engine}" == "terraria" ]; then
  560. fn_details_terraria
  561. elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
  562. fn_details_unreal
  563. elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
  564. fn_details_ark
  565. elif [ "${gamename}" == "Hurtworld" ]; then
  566. fn_details_hurtworld
  567. elif [ "${gamename}" == "7 Days To Die" ]; then
  568. fn_details_sdtd
  569. elif [ "${gamename}" == "TeamSpeak 3" ]; then
  570. fn_details_teamspeak3
  571. elif [ "${gamename}" == "Mumble" ]; then
  572. fn_details_mumble
  573. elif [ "${gamename}" == "Rust" ]; then
  574. fn_details_rust
  575. else
  576. fn_print_error_nl "Unable to detect server engine."
  577. fi
  578. fn_details_statusbottom
  579. core_exit.sh