command_details.sh 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687
  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" "idtech3_ql" "refractor" "realvirtuality" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "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_refractor(){
  330. echo -e "netstat -atunp | grep bf1942_lnxd"
  331. echo -e ""
  332. {
  333. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  334. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  335. echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp"
  336. } | column -s $'\t' -t
  337. }
  338. fn_details_quakelive(){
  339. echo -e "netstat -atunp | grep qzeroded"
  340. echo -e ""
  341. if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then
  342. echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}."
  343. echo -e ""
  344. fi
  345. {
  346. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  347. echo -e "> Game\tINBOUND\t${port}\tudp"
  348. echo -e "> Rcon\tINBOUND\t${rconport}\tudp"
  349. echo -e "> Stats\tINBOUND\t${statsport}\tudp"
  350. } | column -s $'\t' -t
  351. }
  352. fn_details_wolfensteinenemyterritory(){
  353. echo -e "netstat -atunp | grep etded"
  354. echo -e ""
  355. {
  356. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  357. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  358. } | column -s $'\t' -t
  359. }
  360. fn_details_seriousengine35(){
  361. echo -e "netstat -atunp | grep Sam3_Dedicate"
  362. echo -e ""
  363. {
  364. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  365. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp"
  366. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  367. } | column -s $'\t' -t
  368. }
  369. fn_details_source(){
  370. echo -e "netstat -atunp | grep srcds_linux"
  371. echo -e ""
  372. {
  373. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  374. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  375. if [ -n "${sourcetvport}" ]; then
  376. echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp"
  377. fi
  378. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  379. } | column -s $'\t' -t
  380. }
  381. fn_details_spark(){
  382. echo -e "netstat -atunp | grep server_linux3"
  383. echo -e ""
  384. {
  385. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  386. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  387. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  388. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  389. } | column -s $'\t' -t
  390. echo -e ""
  391. echo -e "${lightgreen}${servername} WebAdmin${default}"
  392. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  393. {
  394. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}/index.html"
  395. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  396. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  397. } | column -s $'\t' -t
  398. }
  399. fn_details_starbound(){
  400. echo -e "netstat -atunp | grep starbound"
  401. echo -e ""
  402. {
  403. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  404. echo -e "> Game\tINBOUND\t${port}\ttcp"
  405. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  406. echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
  407. } | column -s $'\t' -t
  408. }
  409. fn_details_teamspeak3(){
  410. echo -e "netstat -atunp | grep ts3server"
  411. echo -e ""
  412. {
  413. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  414. echo -e "> Voice\tINBOUND\t${port}\tudp"
  415. echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp"
  416. echo -e "> File transfer\tINBOUND\t${fileport}\ttcp"
  417. } | column -s $'\t' -t
  418. }
  419. fn_details_mumble(){
  420. echo -e "netstat -atunp | grep murmur"
  421. echo -e ""
  422. {
  423. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  424. echo -e "> Voice\tINBOUND\t${port}\tudp"
  425. echo -e "> ServerQuery\tINBOUND\t${port}\ttcp"
  426. } | column -s $'\t' -t
  427. }
  428. fn_details_teeworlds(){
  429. echo -e "netstat -atunp | grep teeworlds_srv"
  430. echo -e ""
  431. {
  432. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  433. echo -e "> Game\tINBOUND\t${port}\ttcp"
  434. } | column -s $'\t' -t
  435. }
  436. fn_details_terraria(){
  437. echo -e "netstat -atunp | grep TerrariaServer"
  438. echo -e ""
  439. {
  440. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  441. echo -e "> Game\tINBOUND\t${port}\ttcp"
  442. } | column -s $'\t' -t
  443. }
  444. fn_details_sdtd(){
  445. echo -e "netstat -atunp | grep 7DaysToDie"
  446. echo -e ""
  447. {
  448. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  449. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  450. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  451. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  452. echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
  453. } | column -s $'\t' -t
  454. echo -e ""
  455. echo -e "${lightgreen}${servername} WebAdmin${default}"
  456. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  457. {
  458. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  459. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  460. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  461. } | column -s $'\t' -t
  462. echo -e ""
  463. echo -e "${lightgreen}${servername} Telnet${default}"
  464. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  465. {
  466. echo -e "${blue}Telnet enabled:\t${default}${telnetenabled}"
  467. echo -e "${blue}Telnet address:\t${default}${ip} ${telnetport}"
  468. echo -e "${blue}Telnet password:\t${default}${telnetpass}"
  469. } | column -s $'\t' -t
  470. }
  471. fn_details_hurtworld(){
  472. echo -e "netstat -atunp | grep Hurtworld"
  473. echo -e ""
  474. {
  475. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  476. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  477. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  478. } | column -s $'\t' -t
  479. }
  480. fn_details_rust(){
  481. echo -e "netstat -atunp | grep Rust"
  482. echo -e ""
  483. {
  484. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  485. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  486. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  487. } | column -s $'\t' -t
  488. }
  489. fn_details_unreal(){
  490. echo -e "netstat -atunp | grep ucc-bin"
  491. echo -e ""
  492. {
  493. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  494. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  495. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  496. if [ "${engine}" == "unreal" ]; then
  497. echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp"
  498. fi
  499. if [ "${engine}" != "unreal" ] && [ "${appid}" != "223250" ]; then
  500. echo -e "> GameSpy query\tINBOUND\t${gsqueryport}\tudp\tOldQueryPortNumber=${gsqueryport}"
  501. fi
  502. if [ "${appid}" == "215360" ]; then
  503. echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp"
  504. else
  505. echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp"
  506. fi
  507. if [ "${appid}" ]; then
  508. if [ "${appid}" == "223250" ]; then
  509. echo -e "< Steam\tOUTBOUND\t20610\tudp"
  510. else
  511. echo -e "< Steam\tOUTBOUND\t20660\tudp"
  512. fi
  513. fi
  514. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  515. } | column -s $'\t' -t
  516. echo -e ""
  517. echo -e "${lightgreen}${servername} WebAdmin${default}"
  518. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  519. {
  520. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  521. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  522. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  523. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  524. } | column -s $'\t' -t
  525. }
  526. fn_details_ut3(){
  527. echo -e "netstat -atunp | grep ut3-bin"
  528. echo -e ""
  529. {
  530. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  531. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  532. } | column -s $'\t' -t
  533. }
  534. fn_details_ark(){
  535. echo -e "netstat -atunp | grep ShooterGame"
  536. echo -e ""
  537. {
  538. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  539. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  540. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  541. } | column -s $'\t' -t
  542. }
  543. # Run checks and gathers details to display.
  544. fn_display_details() {
  545. check.sh
  546. info_config.sh
  547. info_distro.sh
  548. info_glibc.sh
  549. info_parms.sh
  550. fn_details_os
  551. fn_details_performance
  552. fn_details_disk
  553. fn_details_gameserver
  554. fn_details_script
  555. fn_details_backup
  556. # Some game servers do not have parms.
  557. if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${engine}" != "avalanche" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]; then
  558. fn_parms
  559. fn_details_commandlineparms
  560. fi
  561. fn_details_ports
  562. # Display details depending on game or engine.
  563. if [ "${engine}" == "avalanche" ]; then
  564. fn_details_avalanche
  565. elif [ "${engine}" == "refractor" ]; then
  566. fn_details_refractor
  567. elif [ "${engine}" == "dontstarve" ]; then
  568. fn_details_dontstarve
  569. elif [ "${engine}" == "lwjgl2" ]; then
  570. fn_details_minecraft
  571. elif [ "${engine}" == "projectzomboid" ]; then
  572. fn_details_projectzomboid
  573. elif [ "${engine}" == "realvirtuality" ]; then
  574. fn_details_realvirtuality
  575. elif [ "${engine}" == "seriousengine35" ]; then
  576. fn_details_seriousengine35
  577. elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
  578. fn_details_source
  579. elif [ "${engine}" == "spark" ]; then
  580. fn_details_spark
  581. elif [ "${engine}" == "starbound" ]; then
  582. fn_details_starbound
  583. elif [ "${engine}" == "teeworlds" ]; then
  584. fn_details_teeworlds
  585. elif [ "${engine}" == "terraria" ]; then
  586. fn_details_terraria
  587. elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
  588. fn_details_unreal
  589. elif [ "${engine}" == "unreal3" ]; then
  590. fn_details_ut3
  591. elif [ "${gamename}" == "7 Days To Die" ]; then
  592. fn_details_sdtd
  593. elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
  594. fn_details_ark
  595. elif [ "${gamename}" == "Hurtworld" ]; then
  596. fn_details_hurtworld
  597. elif [ "${gamename}" == "Quake Live" ]; then
  598. fn_details_quakelive
  599. elif [ "${gamename}" == "TeamSpeak 3" ]; then
  600. fn_details_teamspeak3
  601. elif [ "${gamename}" == "Mumble" ]; then
  602. fn_details_mumble
  603. elif [ "${gamename}" == "Rust" ]; then
  604. fn_details_rust
  605. elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
  606. fn_details_wolfensteinenemyterritory
  607. else
  608. fn_print_error_nl "Unable to detect server engine."
  609. fi
  610. fn_details_statusbottom
  611. }
  612. if [ -z "${postdetails}" ] ;
  613. then
  614. fn_display_details
  615. core_exit.sh
  616. fi