fn_details 20 KB

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