command_details.sh 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809
  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. # Maxplayers: 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. # Maxplayers
  121. if [ -n "${maxplayers}" ]; then
  122. echo -e "${blue}Maxplayers:\t${default}${maxplayers}"
  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. # Cluster (Don't Starve Together)
  137. if [ -n "${cluster}" ]; then
  138. echo -e "${blue}Cluster:\t${default}${cluster}"
  139. fi
  140. # Shard (Don't Starve Together)
  141. if [ -n "${shard}" ]; then
  142. echo -e "${blue}Shard:\t${default}${shard}"
  143. fi
  144. # TeamSpeak dbplugin
  145. if [ -n "${dbplugin}" ]; then
  146. echo -e "${blue}dbplugin:\t${default}${dbplugin}"
  147. fi
  148. # Online status
  149. if [ "${status}" == "0" ]; then
  150. echo -e "${blue}Status:\t${red}OFFLINE${default}"
  151. else
  152. echo -e "${blue}Status:\t${green}ONLINE${default}"
  153. fi
  154. } | column -s $'\t' -t
  155. echo -e ""
  156. }
  157. fn_details_script(){
  158. #
  159. # qlserver Script Details
  160. # =====================================
  161. # Service name: ql-server
  162. # qlserver version: 150316
  163. # User: lgsm
  164. # Email alert: off
  165. # Update on start: off
  166. # Location: /home/lgsm/qlserver
  167. # Config file: /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg
  168. echo -e "${lightgreen}${selfname} Script Details${default}"
  169. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  170. {
  171. # Service name
  172. echo -e "${blue}Service name:\t${default}${servicename}"
  173. # Script version
  174. if [ -n "${version}" ]; then
  175. echo -e "${blue}${selfname} version:\t${default}${version}"
  176. fi
  177. # User
  178. echo -e "${blue}User:\t${default}$(whoami)"
  179. # GLIBC required
  180. if [ -n "${glibcrequired}" ]; then
  181. if [ "${glibcrequired}" == "NOT REQUIRED" ]; then
  182. :
  183. elif [ "${glibcrequired}" == "UNKNOWN" ]; then
  184. echo -e "${blue}GLIBC required:\t${red}${glibcrequired}"
  185. elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then
  186. if [ "${glibcfix}" == "yes" ]; then
  187. echo -e "${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${green}Using GLIBC fix${default})"
  188. else
  189. echo -e "${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${red}GLIBC version too old${default})"
  190. fi
  191. else
  192. echo -e "${blue}GLIBC required:\t${green}${glibcrequired}${default}"
  193. fi
  194. fi
  195. # Email alert
  196. echo -e "${blue}Email alert:\t${default}${emailalert}"
  197. # Pushbullet alert
  198. echo -e "${blue}Pushbullet alert:\t${default}${pushbulletalert}"
  199. # Update on start
  200. if [ -n "${updateonstart}" ]; then
  201. echo -e "${blue}Update on start:\t${default}${updateonstart}"
  202. fi
  203. # Script location
  204. echo -e "${blue}Location:\t${default}${rootdir}"
  205. # Config file location
  206. if [ -n "${servercfgfullpath}" ]; then
  207. if [ -f "${servercfgfullpath}" ]; then
  208. echo -e "${blue}Config file:\t${default}${servercfgfullpath}"
  209. elif [ -d "${servercfgfullpath}" ]; then
  210. echo -e "${blue}Config dir:\t${default}${servercfgfullpath}"
  211. else
  212. echo -e "${blue}Config file:\t${default}${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})"
  213. fi
  214. fi
  215. # Network config file location (ARMA 3)
  216. if [ -n "${networkcfgfullpath}" ]; then
  217. echo -e "${blue}Network config file:\t${default}${networkcfgfullpath}"
  218. fi
  219. } | column -s $'\t' -t
  220. }
  221. fn_details_backup(){
  222. #
  223. # Backups
  224. # =====================================
  225. # No. of backups: 1
  226. # Latest backup:
  227. # date: Fri May 6 18:34:19 UTC 2016
  228. # file: /home/lgsm/qlserver/backups/ql-server-2016-05-06-183239.tar.gz
  229. # size: 945M
  230. echo -e ""
  231. echo -e "${lightgreen}Backups${default}"
  232. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  233. if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
  234. echo -e "No Backups created"
  235. else
  236. {
  237. echo -e "${blue}No. of backups:\t${default}${backupcount}"
  238. echo -e "${blue}Latest backup:${default}"
  239. if [ "${lastbackupdaysago}" == "0" ]; then
  240. echo -e "${blue} date:\t${default}${lastbackupdate} (less than 1 day ago)"
  241. elif [ "${lastbackupdaysago}" == "1" ]; then
  242. echo -e "${blue} date:\t${default}${lastbackupdate} (1 day ago)"
  243. else
  244. echo -e "${blue} date:\t${default}${lastbackupdate} (${lastbackupdaysago} days ago)"
  245. fi
  246. echo -e "${blue} file:\t${default}${lastbackup}"
  247. echo -e "${blue} size:\t${default}${lastbackupsize}"
  248. } | column -s $'\t' -t
  249. fi
  250. }
  251. fn_details_commandlineparms(){
  252. #
  253. # Command-line Parameters
  254. # =====================================
  255. # ./run_server_x86.sh +set net_strict 1
  256. echo -e ""
  257. echo -e "${lightgreen}Command-line Parameters${default}"
  258. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  259. echo -e "${executable} ${parms}"
  260. }
  261. fn_details_ports(){
  262. # Ports
  263. # =====================================
  264. # Change ports by editing the parameters in:
  265. # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg
  266. echo -e ""
  267. echo -e "${lightgreen}Ports${default}"
  268. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  269. echo -e "Change ports by editing the parameters in:"
  270. parmslocation="${red}UNKNOWN${default}"
  271. # engines that require editing in the config file
  272. 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" )
  273. for port_edit in "${ports_edit_array[@]}"
  274. do
  275. if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
  276. parmslocation="${servercfgfullpath}"
  277. fi
  278. done
  279. # engines that require editing in the script file
  280. local ports_edit_array=( "Factorio" "goldsource" "Hurtworld" "iw3.0" "Rust" "spark" "source" "starbound" "unreal4" )
  281. for port_edit in "${ports_edit_array[@]}"
  282. do
  283. if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
  284. parmslocation="${selfname}"
  285. fi
  286. done
  287. echo -e "${parmslocation}"
  288. echo -e ""
  289. echo -e "Useful port diagnostic command:"
  290. }
  291. fn_details_statusbottom(){
  292. echo -e ""
  293. if [ "${status}" == "0" ]; then
  294. echo -e "${blue}Status:\t${red}OFFLINE${default}"
  295. else
  296. echo -e "${blue}Status:\t${green}ONLINE${default}"
  297. fi
  298. echo -e ""
  299. }
  300. # Engine Specific details
  301. fn_details_avalanche(){
  302. echo -e "netstat -atunp | grep Jcmp-Server"
  303. echo -e ""
  304. {
  305. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  306. echo -e "> Game\tINBOUND\t${port}\tudp"
  307. } | column -s $'\t' -t
  308. }
  309. fn_details_cod(){
  310. echo -e "netstat -atunp | grep cod_lnxded"
  311. echo -e ""
  312. {
  313. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  314. echo -e "> Game\tINBOUND\t${port}\tudp"
  315. } | column -s $'\t' -t
  316. }
  317. fn_details_coduo(){
  318. echo -e "netstat -atunp | grep coduo_lnxded"
  319. echo -e ""
  320. {
  321. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  322. echo -e "> Game\tINBOUND\t${port}\tudp"
  323. } | column -s $'\t' -t
  324. }
  325. fn_details_cod2(){
  326. echo -e "netstat -atunp | grep cod2_lnxded"
  327. echo -e ""
  328. {
  329. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  330. echo -e "> Game\tINBOUND\t${port}\tudp"
  331. } | column -s $'\t' -t
  332. }
  333. fn_details_cod4(){
  334. echo -e "netstat -atunp"
  335. echo -e ""
  336. {
  337. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  338. echo -e "> Game\tINBOUND\t${port}\tudp"
  339. } | column -s $'\t' -t
  340. }
  341. fn_details_codwaw(){
  342. echo -e "netstat -atunp | grep codwaw_lnxded"
  343. echo -e ""
  344. {
  345. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  346. echo -e "> Game\tINBOUND\t${port}\tudp"
  347. } | column -s $'\t' -t
  348. }
  349. fn_details_dontstarve(){
  350. echo -e "netstat -atunp | grep dontstarve"
  351. echo -e ""
  352. {
  353. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  354. echo -e "> Game: Server\tINBOUND\t${port}\tudp"
  355. echo -e "> Game: Master\tINBOUND\t${masterport}\tudp"
  356. echo -e "> Steam: Auth\tINBOUND\t${steamauthenticationport}\tudp"
  357. echo -e "> Steam: Master\tINBOUND\t${steammasterserverport}\tudp"
  358. } | column -s $'\t' -t
  359. }
  360. fn_details_factorio(){
  361. echo -e "netstat -atunp | grep factorio"
  362. echo -e ""
  363. {
  364. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  365. echo -e "> Game\tINBOUND\t${port}\ttcp"
  366. } | column -s $'\t' -t
  367. }
  368. fn_details_minecraft(){
  369. echo -e "netstat -atunp | grep java"
  370. echo -e ""
  371. {
  372. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  373. echo -e "> Game\tINBOUND\t${port}\tudp"
  374. } | column -s $'\t' -t
  375. }
  376. fn_details_projectzomboid(){
  377. echo -e "netstat -atunp | grep java"
  378. echo -e ""
  379. {
  380. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  381. echo -e "> Game\tINBOUND\t${port}\tudp"
  382. } | column -s $'\t' -t
  383. }
  384. fn_details_realvirtuality(){
  385. echo -e "netstat -atunp | grep arma3server"
  386. echo -e ""
  387. if [ -z "${port}" ]||[ -z "${queryport}" ]||[ -z "${masterport}" ]; then
  388. echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}."
  389. echo -e ""
  390. fi
  391. {
  392. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  393. echo -e "> Game\tINBOUND\t${port}\tudp"
  394. echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp"
  395. echo -e "> Steam: Master traffic\tINBOUND\t${masterport}\tudp"
  396. } | column -s $'\t' -t
  397. }
  398. fn_details_refractor(){
  399. echo -e "netstat -atunp | grep bf1942_lnxd"
  400. echo -e ""
  401. {
  402. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  403. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  404. echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp"
  405. } | column -s $'\t' -t
  406. }
  407. fn_details_quake2(){
  408. echo -e "netstat -atunp | grep quake2"
  409. echo -e ""
  410. {
  411. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  412. echo -e "> Game\tINBOUND\t${port}\tudp"
  413. } | column -s $'\t' -t
  414. }
  415. fn_details_quake3(){
  416. echo -e "netstat -atunp | grep q3ded"
  417. echo -e ""
  418. {
  419. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  420. echo -e "> Game\tINBOUND\t${port}\tudp"
  421. } | column -s $'\t' -t
  422. }
  423. fn_details_quake(){
  424. echo -e "netstat -atunp | grep mvdsv"
  425. echo -e ""
  426. {
  427. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  428. echo -e "> Game\tINBOUND\t${port}\tudp"
  429. } | column -s $'\t' -t
  430. }
  431. fn_details_quakelive(){
  432. echo -e "netstat -atunp | grep qzeroded"
  433. echo -e ""
  434. if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then
  435. echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}."
  436. echo -e ""
  437. fi
  438. {
  439. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  440. echo -e "> Game\tINBOUND\t${port}\tudp"
  441. echo -e "> Rcon\tINBOUND\t${rconport}\tudp"
  442. echo -e "> Stats\tINBOUND\t${statsport}\tudp"
  443. } | column -s $'\t' -t
  444. }
  445. fn_details_wolfensteinenemyterritory(){
  446. echo -e "netstat -atunp | grep etded"
  447. echo -e ""
  448. {
  449. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  450. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  451. } | column -s $'\t' -t
  452. }
  453. fn_details_seriousengine35(){
  454. echo -e "netstat -atunp | grep Sam3_Dedicate"
  455. echo -e ""
  456. {
  457. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  458. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp"
  459. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  460. } | column -s $'\t' -t
  461. }
  462. fn_details_source(){
  463. echo -e "netstat -atunp | grep srcds_linux"
  464. echo -e ""
  465. {
  466. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  467. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  468. if [ -n "${sourcetvport}" ]; then
  469. echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp"
  470. fi
  471. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  472. } | column -s $'\t' -t
  473. }
  474. fn_details_spark(){
  475. echo -e "netstat -atunp | grep server_linux3"
  476. echo -e ""
  477. {
  478. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  479. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  480. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  481. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  482. } | column -s $'\t' -t
  483. echo -e ""
  484. echo -e "${lightgreen}${servername} WebAdmin${default}"
  485. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  486. {
  487. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}/index.html"
  488. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  489. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  490. } | column -s $'\t' -t
  491. }
  492. fn_details_starbound(){
  493. echo -e "netstat -atunp | grep starbound"
  494. echo -e ""
  495. {
  496. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  497. echo -e "> Game\tINBOUND\t${port}\ttcp"
  498. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  499. echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
  500. } | column -s $'\t' -t
  501. }
  502. fn_details_teamspeak3(){
  503. echo -e "netstat -atunp | grep ts3server"
  504. echo -e ""
  505. {
  506. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  507. echo -e "> Voice\tINBOUND\t${port}\tudp"
  508. echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp"
  509. echo -e "> File transfer\tINBOUND\t${fileport}\ttcp"
  510. } | column -s $'\t' -t
  511. }
  512. fn_details_mumble(){
  513. echo -e "netstat -atunp | grep murmur"
  514. echo -e ""
  515. {
  516. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  517. echo -e "> Voice\tINBOUND\t${port}\tudp"
  518. echo -e "> ServerQuery\tINBOUND\t${port}\ttcp"
  519. } | column -s $'\t' -t
  520. }
  521. fn_details_teeworlds(){
  522. echo -e "netstat -atunp | grep teeworlds_srv"
  523. echo -e ""
  524. {
  525. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  526. echo -e "> Game\tINBOUND\t${port}\ttcp"
  527. } | column -s $'\t' -t
  528. }
  529. fn_details_terraria(){
  530. echo -e "netstat -atunp | grep TerrariaServer"
  531. echo -e ""
  532. {
  533. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  534. echo -e "> Game\tINBOUND\t${port}\ttcp"
  535. } | column -s $'\t' -t
  536. }
  537. fn_details_sdtd(){
  538. echo -e "netstat -atunp | grep 7DaysToDie"
  539. echo -e ""
  540. {
  541. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  542. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  543. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  544. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  545. echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
  546. } | column -s $'\t' -t
  547. echo -e ""
  548. echo -e "${lightgreen}${servername} WebAdmin${default}"
  549. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  550. {
  551. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  552. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  553. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  554. } | column -s $'\t' -t
  555. echo -e ""
  556. echo -e "${lightgreen}${servername} Telnet${default}"
  557. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  558. {
  559. echo -e "${blue}Telnet enabled:\t${default}${telnetenabled}"
  560. echo -e "${blue}Telnet address:\t${default}${ip} ${telnetport}"
  561. echo -e "${blue}Telnet password:\t${default}${telnetpass}"
  562. } | column -s $'\t' -t
  563. }
  564. fn_details_hurtworld(){
  565. echo -e "netstat -atunp | grep Hurtworld"
  566. echo -e ""
  567. {
  568. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  569. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  570. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  571. } | column -s $'\t' -t
  572. }
  573. fn_details_rust(){
  574. echo -e "netstat -atunp | grep Rust"
  575. echo -e ""
  576. {
  577. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  578. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  579. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  580. } | column -s $'\t' -t
  581. }
  582. fn_details_unreal(){
  583. echo -e "netstat -atunp | grep ucc-bin"
  584. echo -e ""
  585. {
  586. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  587. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  588. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  589. if [ "${engine}" == "unreal" ]; then
  590. echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp"
  591. fi
  592. if [ "${engine}" != "unreal" ] && [ "${appid}" != "223250" ]; then
  593. echo -e "> GameSpy query\tINBOUND\t${gsqueryport}\tudp\tOldQueryPortNumber=${gsqueryport}"
  594. fi
  595. if [ "${appid}" == "215360" ]; then
  596. echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp"
  597. else
  598. echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp"
  599. fi
  600. if [ "${appid}" ]; then
  601. if [ "${appid}" == "223250" ]; then
  602. echo -e "< Steam\tOUTBOUND\t20610\tudp"
  603. else
  604. echo -e "< Steam\tOUTBOUND\t20660\tudp"
  605. fi
  606. fi
  607. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  608. } | column -s $'\t' -t
  609. echo -e ""
  610. echo -e "${lightgreen}${servername} WebAdmin${default}"
  611. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  612. {
  613. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  614. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  615. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  616. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  617. } | column -s $'\t' -t
  618. }
  619. fn_details_ut3(){
  620. echo -e "netstat -atunp | grep ut3-bin"
  621. echo -e ""
  622. {
  623. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  624. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  625. } | column -s $'\t' -t
  626. }
  627. fn_details_ark(){
  628. echo -e "netstat -atunp | grep ShooterGame"
  629. echo -e ""
  630. {
  631. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  632. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  633. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  634. } | column -s $'\t' -t
  635. }
  636. # Run checks and gathers details to display.
  637. fn_display_details() {
  638. check.sh
  639. info_config.sh
  640. info_distro.sh
  641. info_glibc.sh
  642. info_parms.sh
  643. fn_details_os
  644. fn_details_performance
  645. fn_details_disk
  646. fn_details_gameserver
  647. fn_details_script
  648. fn_details_backup
  649. # Some game servers do not have parms.
  650. if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${engine}" != "avalanche" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]; then
  651. fn_parms
  652. fn_details_commandlineparms
  653. fi
  654. fn_details_ports
  655. # Display details depending on game or engine.
  656. if [ "${engine}" == "avalanche" ]; then
  657. fn_details_avalanche
  658. elif [ "${engine}" == "refractor" ]; then
  659. fn_details_refractor
  660. elif [ "${engine}" == "dontstarve" ]; then
  661. fn_details_dontstarve
  662. elif [ "${engine}" == "lwjgl2" ]; then
  663. fn_details_minecraft
  664. elif [ "${engine}" == "projectzomboid" ]; then
  665. fn_details_projectzomboid
  666. elif [ "${engine}" == "realvirtuality" ]; then
  667. fn_details_realvirtuality
  668. elif [ "${engine}" == "seriousengine35" ]; then
  669. fn_details_seriousengine35
  670. elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
  671. fn_details_source
  672. elif [ "${engine}" == "spark" ]; then
  673. fn_details_spark
  674. elif [ "${engine}" == "starbound" ]; then
  675. fn_details_starbound
  676. elif [ "${engine}" == "teeworlds" ]; then
  677. fn_details_teeworlds
  678. elif [ "${engine}" == "terraria" ]; then
  679. fn_details_terraria
  680. elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
  681. fn_details_unreal
  682. elif [ "${engine}" == "unreal3" ]; then
  683. fn_details_ut3
  684. elif [ "${gamename}" == "7 Days To Die" ]; then
  685. fn_details_sdtd
  686. elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
  687. fn_details_ark
  688. elif [ "${gamename}" == "Call of Duty" ]; then
  689. fn_details_cod
  690. elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then
  691. fn_details_coduo
  692. elif [ "${gamename}" == "Call of Duty 2" ]; then
  693. fn_details_cod2
  694. elif [ "${gamename}" == "Call of Duty 4" ]; then
  695. fn_details_cod4
  696. elif [ "${gamename}" == "Call of Duty: World at War" ]; then
  697. fn_details_codwaw
  698. elif [ "${gamename}" == "Hurtworld" ]; then
  699. fn_details_hurtworld
  700. elif [ "${gamename}" == "QuakeWorld" ]; then
  701. fn_details_quake
  702. elif [ "${gamename}" == "Quake 2" ]; then
  703. fn_details_quake2
  704. elif [ "${gamename}" == "Quake 3: Arena" ]; then
  705. fn_details_quake3
  706. elif [ "${gamename}" == "Quake Live" ]; then
  707. fn_details_quakelive
  708. elif [ "${gamename}" == "TeamSpeak 3" ]; then
  709. fn_details_teamspeak3
  710. elif [ "${gamename}" == "Mumble" ]; then
  711. fn_details_mumble
  712. elif [ "${gamename}" == "Rust" ]; then
  713. fn_details_rust
  714. elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
  715. fn_details_wolfensteinenemyterritory
  716. elif [ "${gamename}" == "Factorio" ]; then
  717. fn_details_factorio
  718. else
  719. fn_print_error_nl "Unable to detect server engine."
  720. fi
  721. fn_details_statusbottom
  722. }
  723. if [ -z "${postdetails}" ] ;
  724. then
  725. fn_display_details
  726. core_exit.sh
  727. fi