command_details.sh 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724
  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. if [ -n "${updateonstart}" ]; then
  193. echo -e "${blue}Update on start:\t${default}${updateonstart}"
  194. fi
  195. # Script location
  196. echo -e "${blue}Location:\t${default}${rootdir}"
  197. # Config file location
  198. if [ -n "${servercfgfullpath}" ]; then
  199. if [ -f "${servercfgfullpath}" ]; then
  200. echo -e "${blue}Config file:\t${default}${servercfgfullpath}"
  201. elif [ -d "${servercfgfullpath}" ]; then
  202. echo -e "${blue}Config dir:\t${default}${servercfgfullpath}"
  203. else
  204. echo -e "${blue}Config file:\t${default}${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})"
  205. fi
  206. fi
  207. # Network config file location (ARMA 3)
  208. if [ -n "${networkcfgfullpath}" ]; then
  209. echo -e "${blue}Network config file:\t${default}${networkcfgfullpath}"
  210. fi
  211. } | column -s $'\t' -t
  212. }
  213. fn_details_backup(){
  214. #
  215. # Backups
  216. # =====================================
  217. # No. of backups: 1
  218. # Latest backup:
  219. # date: Fri May 6 18:34:19 UTC 2016
  220. # file: /home/lgsm/qlserver/backups/ql-server-2016-05-06-183239.tar.gz
  221. # size: 945M
  222. echo -e ""
  223. echo -e "${lightgreen}Backups${default}"
  224. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  225. if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
  226. echo -e "No Backups created"
  227. else
  228. {
  229. echo -e "${blue}No. of backups:\t${default}${backupcount}"
  230. echo -e "${blue}Latest backup:${default}"
  231. echo -e "${blue} date:\t${default}${lastbackupdate}"
  232. echo -e "${blue} file:\t${default}${lastbackup}"
  233. echo -e "${blue} size:\t${default}${lastbackupsize}"
  234. } | column -s $'\t' -t
  235. fi
  236. }
  237. fn_details_commandlineparms(){
  238. #
  239. # Command-line Parameters
  240. # =====================================
  241. # ./run_server_x86.sh +set net_strict 1
  242. echo -e ""
  243. echo -e "${lightgreen}Command-line Parameters${default}"
  244. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  245. echo -e "${executable} ${parms}"
  246. }
  247. fn_details_ports(){
  248. # Ports
  249. # =====================================
  250. # Change ports by editing the parameters in:
  251. # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg
  252. echo -e ""
  253. echo -e "${lightgreen}Ports${default}"
  254. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  255. echo -e "Change ports by editing the parameters in:"
  256. parmslocation="${red}UNKNOWN${default}"
  257. # engines that require editing in the config file
  258. local ports_edit_array=( "avalanche" "dontstarve" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "projectzomboid" "quake" "refractor" "realvirtuality" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" )
  259. for port_edit in "${ports_edit_array[@]}"
  260. do
  261. if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
  262. parmslocation="${servercfgfullpath}"
  263. fi
  264. done
  265. # engines that require editing in the script file
  266. local ports_edit_array=( "starbound" "spark" "source" "goldsource" "Rust" "Hurtworld" "unreal4")
  267. for port_edit in "${ports_edit_array[@]}"
  268. do
  269. if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
  270. parmslocation="${selfname}"
  271. fi
  272. done
  273. echo -e "${parmslocation}"
  274. echo -e ""
  275. echo -e "Useful port diagnostic command:"
  276. }
  277. fn_details_statusbottom(){
  278. echo -e ""
  279. if [ "${status}" == "0" ]; then
  280. echo -e "${blue}Status:\t${red}OFFLINE${default}"
  281. else
  282. echo -e "${blue}Status:\t${green}ONLINE${default}"
  283. fi
  284. echo -e ""
  285. }
  286. # Engine Specific details
  287. fn_details_avalanche(){
  288. echo -e "netstat -atunp | grep Jcmp-Server"
  289. echo -e ""
  290. {
  291. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  292. echo -e "> Game\tINBOUND\t${port}\tudp"
  293. } | column -s $'\t' -t
  294. }
  295. fn_details_dontstarve(){
  296. echo -e "netstat -atunp | grep dontstarve"
  297. echo -e ""
  298. {
  299. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  300. echo -e "> Game\tINBOUND\t${port}\tudp"
  301. } | column -s $'\t' -t
  302. }
  303. fn_details_minecraft(){
  304. echo -e "netstat -atunp | grep java"
  305. echo -e ""
  306. {
  307. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  308. echo -e "> Game\tINBOUND\t${port}\tudp"
  309. } | column -s $'\t' -t
  310. }
  311. fn_details_projectzomboid(){
  312. echo -e "netstat -atunp | grep java"
  313. echo -e ""
  314. {
  315. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  316. echo -e "> Game\tINBOUND\t${port}\tudp"
  317. } | column -s $'\t' -t
  318. }
  319. fn_details_realvirtuality(){
  320. echo -e "netstat -atunp | grep arma3server"
  321. echo -e ""
  322. if [ -z "${port}" ]||[ -z "${queryport}" ]||[ -z "${masterport}" ]; then
  323. echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}."
  324. echo -e ""
  325. fi
  326. {
  327. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  328. echo -e "> Game\tINBOUND\t${port}\tudp"
  329. echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp"
  330. echo -e "> Steam: Master traffic\tINBOUND\t${masterport}\tudp"
  331. } | column -s $'\t' -t
  332. }
  333. fn_details_refractor(){
  334. echo -e "netstat -atunp | grep bf1942_lnxd"
  335. echo -e ""
  336. {
  337. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  338. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  339. echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp"
  340. } | column -s $'\t' -t
  341. }
  342. fn_details_quake2(){
  343. echo -e "netstat -atunp | grep quake2"
  344. echo -e ""
  345. {
  346. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  347. echo -e "> Game\tINBOUND\t${port}\tudp"
  348. } | column -s $'\t' -t
  349. }
  350. fn_details_quake3(){
  351. echo -e "netstat -atunp | grep q3ded"
  352. echo -e ""
  353. {
  354. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  355. echo -e "> Game\tINBOUND\t${port}\tudp"
  356. } | column -s $'\t' -t
  357. }
  358. fn_details_quake(){
  359. echo -e "netstat -atunp | grep mvdsv"
  360. echo -e ""
  361. {
  362. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  363. echo -e "> Game\tINBOUND\t${port}\tudp"
  364. } | column -s $'\t' -t
  365. }
  366. fn_details_quakelive(){
  367. echo -e "netstat -atunp | grep qzeroded"
  368. echo -e ""
  369. if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then
  370. echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}."
  371. echo -e ""
  372. fi
  373. {
  374. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  375. echo -e "> Game\tINBOUND\t${port}\tudp"
  376. echo -e "> Rcon\tINBOUND\t${rconport}\tudp"
  377. echo -e "> Stats\tINBOUND\t${statsport}\tudp"
  378. } | column -s $'\t' -t
  379. }
  380. fn_details_wolfensteinenemyterritory(){
  381. echo -e "netstat -atunp | grep etded"
  382. echo -e ""
  383. {
  384. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  385. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  386. } | column -s $'\t' -t
  387. }
  388. fn_details_seriousengine35(){
  389. echo -e "netstat -atunp | grep Sam3_Dedicate"
  390. echo -e ""
  391. {
  392. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  393. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp"
  394. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  395. } | column -s $'\t' -t
  396. }
  397. fn_details_source(){
  398. echo -e "netstat -atunp | grep srcds_linux"
  399. echo -e ""
  400. {
  401. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  402. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  403. if [ -n "${sourcetvport}" ]; then
  404. echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp"
  405. fi
  406. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  407. } | column -s $'\t' -t
  408. }
  409. fn_details_spark(){
  410. echo -e "netstat -atunp | grep server_linux3"
  411. echo -e ""
  412. {
  413. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  414. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  415. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  416. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  417. } | column -s $'\t' -t
  418. echo -e ""
  419. echo -e "${lightgreen}${servername} WebAdmin${default}"
  420. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  421. {
  422. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}/index.html"
  423. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  424. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  425. } | column -s $'\t' -t
  426. }
  427. fn_details_starbound(){
  428. echo -e "netstat -atunp | grep starbound"
  429. echo -e ""
  430. {
  431. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  432. echo -e "> Game\tINBOUND\t${port}\ttcp"
  433. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  434. echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
  435. } | column -s $'\t' -t
  436. }
  437. fn_details_teamspeak3(){
  438. echo -e "netstat -atunp | grep ts3server"
  439. echo -e ""
  440. {
  441. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  442. echo -e "> Voice\tINBOUND\t${port}\tudp"
  443. echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp"
  444. echo -e "> File transfer\tINBOUND\t${fileport}\ttcp"
  445. } | column -s $'\t' -t
  446. }
  447. fn_details_mumble(){
  448. echo -e "netstat -atunp | grep murmur"
  449. echo -e ""
  450. {
  451. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  452. echo -e "> Voice\tINBOUND\t${port}\tudp"
  453. echo -e "> ServerQuery\tINBOUND\t${port}\ttcp"
  454. } | column -s $'\t' -t
  455. }
  456. fn_details_teeworlds(){
  457. echo -e "netstat -atunp | grep teeworlds_srv"
  458. echo -e ""
  459. {
  460. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  461. echo -e "> Game\tINBOUND\t${port}\ttcp"
  462. } | column -s $'\t' -t
  463. }
  464. fn_details_terraria(){
  465. echo -e "netstat -atunp | grep TerrariaServer"
  466. echo -e ""
  467. {
  468. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  469. echo -e "> Game\tINBOUND\t${port}\ttcp"
  470. } | column -s $'\t' -t
  471. }
  472. fn_details_sdtd(){
  473. echo -e "netstat -atunp | grep 7DaysToDie"
  474. echo -e ""
  475. {
  476. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  477. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  478. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  479. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  480. echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
  481. } | column -s $'\t' -t
  482. echo -e ""
  483. echo -e "${lightgreen}${servername} WebAdmin${default}"
  484. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  485. {
  486. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  487. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  488. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  489. } | column -s $'\t' -t
  490. echo -e ""
  491. echo -e "${lightgreen}${servername} Telnet${default}"
  492. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  493. {
  494. echo -e "${blue}Telnet enabled:\t${default}${telnetenabled}"
  495. echo -e "${blue}Telnet address:\t${default}${ip} ${telnetport}"
  496. echo -e "${blue}Telnet password:\t${default}${telnetpass}"
  497. } | column -s $'\t' -t
  498. }
  499. fn_details_hurtworld(){
  500. echo -e "netstat -atunp | grep Hurtworld"
  501. echo -e ""
  502. {
  503. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  504. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  505. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  506. } | column -s $'\t' -t
  507. }
  508. fn_details_rust(){
  509. echo -e "netstat -atunp | grep Rust"
  510. echo -e ""
  511. {
  512. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  513. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  514. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  515. } | column -s $'\t' -t
  516. }
  517. fn_details_unreal(){
  518. echo -e "netstat -atunp | grep ucc-bin"
  519. echo -e ""
  520. {
  521. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  522. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  523. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  524. if [ "${engine}" == "unreal" ]; then
  525. echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp"
  526. fi
  527. if [ "${engine}" != "unreal" ] && [ "${appid}" != "223250" ]; then
  528. echo -e "> GameSpy query\tINBOUND\t${gsqueryport}\tudp\tOldQueryPortNumber=${gsqueryport}"
  529. fi
  530. if [ "${appid}" == "215360" ]; then
  531. echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp"
  532. else
  533. echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp"
  534. fi
  535. if [ "${appid}" ]; then
  536. if [ "${appid}" == "223250" ]; then
  537. echo -e "< Steam\tOUTBOUND\t20610\tudp"
  538. else
  539. echo -e "< Steam\tOUTBOUND\t20660\tudp"
  540. fi
  541. fi
  542. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  543. } | column -s $'\t' -t
  544. echo -e ""
  545. echo -e "${lightgreen}${servername} WebAdmin${default}"
  546. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  547. {
  548. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  549. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  550. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  551. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  552. } | column -s $'\t' -t
  553. }
  554. fn_details_ut3(){
  555. echo -e "netstat -atunp | grep ut3-bin"
  556. echo -e ""
  557. {
  558. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  559. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  560. } | column -s $'\t' -t
  561. }
  562. fn_details_ark(){
  563. echo -e "netstat -atunp | grep ShooterGame"
  564. echo -e ""
  565. {
  566. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  567. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  568. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  569. } | column -s $'\t' -t
  570. }
  571. # Run checks and gathers details to display.
  572. fn_display_details() {
  573. check.sh
  574. info_config.sh
  575. info_distro.sh
  576. info_glibc.sh
  577. info_parms.sh
  578. fn_details_os
  579. fn_details_performance
  580. fn_details_disk
  581. fn_details_gameserver
  582. fn_details_script
  583. fn_details_backup
  584. # Some game servers do not have parms.
  585. if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${engine}" != "avalanche" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]; then
  586. fn_parms
  587. fn_details_commandlineparms
  588. fi
  589. fn_details_ports
  590. # Display details depending on game or engine.
  591. if [ "${engine}" == "avalanche" ]; then
  592. fn_details_avalanche
  593. elif [ "${engine}" == "refractor" ]; then
  594. fn_details_refractor
  595. elif [ "${engine}" == "dontstarve" ]; then
  596. fn_details_dontstarve
  597. elif [ "${engine}" == "lwjgl2" ]; then
  598. fn_details_minecraft
  599. elif [ "${engine}" == "projectzomboid" ]; then
  600. fn_details_projectzomboid
  601. elif [ "${engine}" == "realvirtuality" ]; then
  602. fn_details_realvirtuality
  603. elif [ "${engine}" == "seriousengine35" ]; then
  604. fn_details_seriousengine35
  605. elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
  606. fn_details_source
  607. elif [ "${engine}" == "spark" ]; then
  608. fn_details_spark
  609. elif [ "${engine}" == "starbound" ]; then
  610. fn_details_starbound
  611. elif [ "${engine}" == "teeworlds" ]; then
  612. fn_details_teeworlds
  613. elif [ "${engine}" == "terraria" ]; then
  614. fn_details_terraria
  615. elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
  616. fn_details_unreal
  617. elif [ "${engine}" == "unreal3" ]; then
  618. fn_details_ut3
  619. elif [ "${gamename}" == "7 Days To Die" ]; then
  620. fn_details_sdtd
  621. elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
  622. fn_details_ark
  623. elif [ "${gamename}" == "Hurtworld" ]; then
  624. fn_details_hurtworld
  625. elif [ "${gamename}" == "QuakeWorld" ]; then
  626. fn_details_quake
  627. elif [ "${gamename}" == "Quake 2" ]; then
  628. fn_details_quake2
  629. elif [ "${gamename}" == "Quake 3: Arena" ]; then
  630. fn_details_quake3
  631. elif [ "${gamename}" == "Quake Live" ]; then
  632. fn_details_quakelive
  633. elif [ "${gamename}" == "TeamSpeak 3" ]; then
  634. fn_details_teamspeak3
  635. elif [ "${gamename}" == "Mumble" ]; then
  636. fn_details_mumble
  637. elif [ "${gamename}" == "Rust" ]; then
  638. fn_details_rust
  639. elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
  640. fn_details_wolfensteinenemyterritory
  641. else
  642. fn_print_error_nl "Unable to detect server engine."
  643. fi
  644. fn_details_statusbottom
  645. }
  646. if [ -z "${postdetails}" ] ;
  647. then
  648. fn_display_details
  649. core_exit.sh
  650. fi