command_details.sh 19 KB

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