fn_details 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557
  1. #!/bin/bash
  2. # LGSM fn_details function
  3. # Author: Daniel Gibbs
  4. # Website: http://gameservermanagers.com
  5. # Version: 100715
  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. echo -e "\e[34mDistro:\t\e[0m${os}" >> .fn_details_distro
  14. echo -e "\e[34mArch:\t\e[0m${arch}" >> .fn_details_distro
  15. echo -e "\e[34mKernel:\t\e[0m${kernel}" >> .fn_details_distro
  16. echo -e "\e[34mHostname:\t\e[0m$HOSTNAME" >> .fn_details_distro
  17. echo -e "\e[34mtmux:\t\e[0m${tmuxv}" >> .fn_details_distro
  18. echo -e "\e[34mGLIBC:\t\e[0m${glibcv}" >> .fn_details_distro
  19. column -s $'\t' -t .fn_details_distro
  20. rm -f .fn_details_distro
  21. }
  22. fn_details_performance(){
  23. echo -e ""
  24. echo -e "\e[93mPerformance\e[0m"
  25. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  26. echo -e "\e[34mUptime:\t\e[0m${days}d, ${hours}h, ${minutes}m" >> .fn_details_performance
  27. echo -e "\e[34mAvg Load:\t\e[0m${load}" >> .fn_details_performance
  28. column -s $'\t' -t .fn_details_performance
  29. rm -f .fn_details_performance
  30. echo -e ""
  31. echo -e "\e[34mMem:\t\e[34mtotal\t used\t free\e[0m" >> .fn_details_performance
  32. echo -e "\e[34mPhysical:\t\e[0m${physmemtotal}\t${physmemused}\t${physmemfree}\e[0m" >> .fn_details_performance
  33. echo -e "\e[34mSwap:\t\e[0m${swaptotal}\t${swapused}\t${swapfree}\e[0m" >> .fn_details_performance
  34. column -s $'\t' -t .fn_details_performance
  35. rm -f .fn_details_performance
  36. }
  37. fn_details_disk(){
  38. echo -e ""
  39. echo -e "\e[93mStorage\e[0m"
  40. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  41. echo -e "\e[34mFilesystem:\t\e[0m${filesystem}" >> .fn_details_disk
  42. echo -e "\e[34mTotal:\t\e[0m${totalspace}" >> .fn_details_disk
  43. echo -e "\e[34mUsed:\t\e[0m${usedspace}" >> .fn_details_disk
  44. echo -e "\e[34mAvailable:\t\e[0m${availspace}" >> .fn_details_disk
  45. echo -e "\e[34mServerfiles:\t\e[0m${serverfilesdu}" >> .fn_details_disk
  46. if [ -d "${backupdir}" ]; then
  47. echo -e "\e[34mBackups:\t\e[0m${backupdirdu}" >> .fn_details_disk
  48. fi
  49. column -s $'\t' -t .fn_details_disk
  50. rm -f .fn_details_disk
  51. }
  52. fn_details_gameserver(){
  53. echo -e ""
  54. echo -e "\e[92m${gamename} Server Details\e[0m"
  55. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  56. echo -e "\e[34mServer name:\t\e[0m${servername}" >> .fn_details_gameserver
  57. echo -e "\e[34mServer IP:\t\e[0m${ip}:${port}" >> .fn_details_gameserver
  58. if [ ! -z "${rcon}" ]; then
  59. echo -e "\e[34mRCON password:\t\e[0m${rcon}" >> .fn_details_gameserver
  60. fi
  61. if [ "${gamename}" == "Teamspeak 3" ]; then
  62. fn_check_ts3status
  63. if [ "${ts3status}" = "Server seems to have died" ] || [ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then
  64. echo -e "\e[34mStatus:\t\e[0;31mOFFLINE\e[0m" >> .fn_details_gameserver
  65. else
  66. echo -e "\e[34mStatus:\t\e[0;32mONLINE\e[0m" >> .fn_details_gameserver
  67. fi
  68. else
  69. pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
  70. if [ "${pid}" == "0" ]; then
  71. echo -e "\e[34mStatus:\t\e[0;31mOFFLINE\e[0m" >> .fn_details_gameserver
  72. else
  73. echo -e "\e[34mStatus:\t\e[0;32mONLINE\e[0m" >> .fn_details_gameserver
  74. fi
  75. fi
  76. column -s $'\t' -t .fn_details_gameserver
  77. rm -f .fn_details_gameserver
  78. echo -e ""
  79. echo -e "\e[34mService name:\t\e[0m${servicename}" >> .fn_details_gameserver
  80. if [ -n ${version} ]; then
  81. echo -e "\e[34m${selfname} version:\t\e[0m${version}" >> .fn_details_gameserver
  82. fi
  83. echo -e "\e[34mUser:\t\e[0m$(whoami)" >> .fn_details_gameserver
  84. echo -e "\e[34mLocation:\t\e[0m${rootdir}" >> .fn_details_gameserver
  85. if [ ! -z "${servercfgfullpath}" ]; then
  86. echo -e "\e[34mConfig file:\t\e[0m${servercfgfullpath}" >> .fn_details_gameserver
  87. fi
  88. if [ "${gamename}" == "Teamspeak 3" ]; then
  89. echo -e "\e[34mdbplugin:\t\e[0m${dbplugin}" >> .fn_details_gameserver
  90. fi
  91. column -s $'\t' -t .fn_details_gameserver
  92. rm -f .fn_details_gameserver
  93. }
  94. fn_details_backup(){
  95. echo -e ""
  96. echo -e "\e[92mBackups\e[0m"
  97. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  98. if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
  99. echo -e "No Backups created"
  100. else
  101. echo -e "\e[34mNo. of backups:\t\e[0m${backupcount}" >> .fn_details_backup
  102. echo -e "\e[34mLatest backup:\e[0m" >> .fn_details_backup
  103. echo -e "\e[34m date:\t\e[0m${lastbackupdate}" >> .fn_details_backup
  104. echo -e "\e[34m file:\t\e[0m${lastbackup}" >> .fn_details_backup
  105. echo -e "\e[34m size:\t\e[0m${lastbackupsize}" >> .fn_details_backup
  106. column -s $'\t' -t .fn_details_backup
  107. rm -f .fn_details_backup
  108. fi
  109. }
  110. fn_details_commandlineparms(){
  111. echo -e ""
  112. echo -e "\e[92mCommand-line Parameters\e[0m"
  113. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  114. echo -e "${executable} ${parms}"
  115. }
  116. fn_details_statusbottom(){
  117. echo -e ""
  118. if [ "${gamename}" == "Teamspeak 3" ]; then
  119. if [ "${ts3status}" = "Server seems to have died" ] || [ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then
  120. echo -e "\e[34mStatus: \e[0;31mOFFLINE\e[0m"
  121. else
  122. echo -e "\e[34mStatus: \e[0;32mONLINE\e[0m"
  123. fi
  124. else
  125. if [ "${pid}" == "0" ]; then
  126. echo -e "\e[34mStatus: \e[0;31mOFFLINE\e[0m"
  127. else
  128. echo -e "\e[34mStatus: \e[0;32mONLINE\e[0m"
  129. fi
  130. fi
  131. echo -e ""
  132. }
  133. # Engine Specific details
  134. fn_details_avalanche(){
  135. fn_check_ip
  136. fn_details_config
  137. fn_details_distro
  138. fn_details_os
  139. fn_details_performance
  140. fn_details_disk
  141. fn_details_gameserver
  142. fn_details_backup
  143. pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
  144. echo -e ""
  145. echo -e "\e[92mPorts\e[0m"
  146. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  147. echo -e "Change ports by editing the command-line"
  148. echo -e "parameters in ${selfname}."
  149. echo -e ""
  150. echo -e "Useful port diagnostic command:"
  151. echo -e "netstat -atunp | grep Jcmp-Server"
  152. echo -e ""
  153. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  154. echo -e "> Game/RCON\tINBOUND\t${port}\tudp" >> .fn_details_ports
  155. column -s $'\t' -t .fn_details_ports
  156. rm -f .fn_details_ports
  157. fn_details_statusbottom
  158. }
  159. fn_details_dontstarve(){
  160. fn_check_ip
  161. fn_details_config
  162. fn_details_distro
  163. fn_details_os
  164. fn_details_performance
  165. fn_details_disk
  166. fn_details_gameserver
  167. fn_details_backup
  168. pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
  169. echo -e ""
  170. echo -e "\e[92mPorts\e[0m"
  171. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  172. echo -e "Change ports by editing the parameters in"
  173. echo -e "${servercfgfullpath}."
  174. echo -e ""
  175. echo -e "Useful port diagnostic command:"
  176. echo -e "netstat -atunp | grep dontstarve"
  177. echo -e ""
  178. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  179. echo -e "> Game\tINBOUND\t${port}\tudp" >> .fn_details_ports
  180. column -s $'\t' -t .fn_details_ports
  181. rm -f .fn_details_ports
  182. fn_details_statusbottom
  183. }
  184. fn_details_projectzomboid(){
  185. fn_check_ip
  186. fn_details_config
  187. fn_details_distro
  188. fn_details_os
  189. fn_details_performance
  190. fn_details_disk
  191. fn_details_gameserver
  192. fn_details_backup
  193. pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
  194. echo -e ""
  195. echo -e "\e[92mPorts\e[0m"
  196. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  197. echo -e "Change ports by editing the parameters in"
  198. echo -e "${servercfgfullpath}."
  199. echo -e ""
  200. echo -e "Useful port diagnostic command:"
  201. echo -e "netstat -atunp | grep java"
  202. echo -e ""
  203. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  204. echo -e "> Game\tINBOUND\t${port}\tudp" >> .fn_details_ports
  205. column -s $'\t' -t .fn_details_ports
  206. rm -f .fn_details_ports
  207. fn_details_statusbottom
  208. }
  209. fn_details_realvirtuality(){
  210. fn_check_ip
  211. pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
  212. fn_parms
  213. fn_details_config
  214. fn_details_distro
  215. fn_details_os
  216. fn_details_performance
  217. fn_details_disk
  218. fn_details_gameserver
  219. fn_details_backup
  220. fn_details_commandlineparms
  221. echo -e ""
  222. echo -e "\e[92mPorts\e[0m"
  223. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  224. echo -e "Change ports by editing the parameters in"
  225. echo -e "${servercfgfullpath}."
  226. echo -e ""
  227. echo -e "Useful port diagnostic command:"
  228. echo -e "netstat -atunp | grep arma3server"
  229. echo -e ""
  230. if [ -z ${port} ] || [ -z ${queryport} ] || [ -z ${masterport} ] ; then
  231. echo -e "\e[0;31mERROR!\e[0m Missing/commented ports in ${servercfg}."
  232. echo -e ""
  233. fi
  234. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  235. echo -e "> Game\tINBOUND\t${port}\tudp" >> .fn_details_ports
  236. echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp" >> .fn_details_ports
  237. echo -e "> Steam: Master traffic\tINBOUND\t${masterport}\tudp" >> .fn_details_ports
  238. column -s $'\t' -t .fn_details_ports
  239. rm -f .fn_details_ports
  240. fn_details_statusbottom
  241. }
  242. fn_details_seriousengine35(){
  243. fn_check_ip
  244. pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
  245. fn_parms
  246. fn_details_config
  247. fn_details_distro
  248. fn_details_os
  249. fn_details_performance
  250. fn_details_disk
  251. fn_details_gameserver
  252. fn_details_backup
  253. fn_details_commandlineparms
  254. echo -e ""
  255. echo -e "\e[92mPorts\e[0m"
  256. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  257. echo -e "Change ports by editing the parameters in"
  258. echo -e "${servercfgfullpath}."
  259. echo -e ""
  260. echo -e "Useful port diagnostic command:"
  261. echo -e "netstat -atunp | grep Sam3_Dedicate"
  262. echo -e ""
  263. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  264. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp" >> .fn_details_ports
  265. echo -e "> Query\tINBOUND\t${queryport}\tudp" >> .fn_details_ports
  266. column -s $'\t' -t .fn_details_ports
  267. rm -f .fn_details_ports
  268. fn_details_statusbottom
  269. }
  270. fn_details_source(){
  271. fn_check_ip
  272. fn_parms
  273. fn_details_config
  274. fn_details_distro
  275. fn_details_os
  276. fn_details_performance
  277. fn_details_disk
  278. fn_details_gameserver
  279. fn_details_backup
  280. fn_details_commandlineparms
  281. echo -e ""
  282. echo -e "\e[92mPorts\e[0m"
  283. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  284. echo -e "Change ports by editing the command-line"
  285. echo -e "parameters in ${selfname}."
  286. echo -e ""
  287. echo -e "Useful port diagnostic command:"
  288. echo -e "netstat -atunp | grep srcds_linux"
  289. echo -e ""
  290. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  291. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp" >> .fn_details_ports
  292. if [ ! -z "${sourcetvport}" ]; then
  293. echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp" >> .fn_details_ports
  294. fi
  295. echo -e "< Client\tOUTBOUND\t${clientport}\tudp" >> .fn_details_ports
  296. column -s $'\t' -t .fn_details_ports
  297. rm -f .fn_details_ports
  298. fn_details_statusbottom
  299. }
  300. fn_details_spark(){
  301. fn_check_ip
  302. pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
  303. fn_parms
  304. fn_details_config
  305. fn_details_distro
  306. fn_details_os
  307. fn_details_performance
  308. fn_details_disk
  309. fn_details_gameserver
  310. fn_details_backup
  311. fn_details_commandlineparms
  312. echo -e ""
  313. echo -e "\e[92mPorts\e[0m"
  314. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  315. echo -e "Change ports by editing the command-line"
  316. echo -e "parameters in ${selfname}."
  317. echo -e ""
  318. echo -e "Useful port diagnostic command:"
  319. echo -e "netstat -atunp | grep server_linux3"
  320. echo -e ""
  321. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  322. echo -e "> Game/RCON\tINBOUND\t${port}\tudp" >> .fn_details_ports
  323. echo -e "> Query\tINBOUND\t${queryport}\tudp" >> .fn_details_ports
  324. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp" >> .fn_details_ports
  325. column -s $'\t' -t .fn_details_ports
  326. rm -f .fn_details_ports
  327. echo -e ""
  328. echo -e "\e[92m${servername} WebAdmin\e[0m"
  329. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  330. echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}/index.html" >> .fn_details_ports
  331. echo -e "\e[34mWebAdmin username:\t\e[0m${webadminuser}" >> .fn_details_ports
  332. echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}" >> .fn_details_ports
  333. column -s $'\t' -t .fn_details_ports
  334. rm -f .fn_details_ports
  335. fn_details_statusbottom
  336. }
  337. fn_details_starbound(){
  338. fn_check_ip
  339. fn_parms
  340. fn_details_config
  341. fn_details_distro
  342. fn_details_os
  343. fn_details_performance
  344. fn_details_disk
  345. fn_details_gameserver
  346. fn_details_backup
  347. fn_details_commandlineparms
  348. echo -e ""
  349. echo -e "\e[92mPorts\e[0m"
  350. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  351. echo -e "Change ports by editing the command-line"
  352. echo -e "parameters in ${selfname}."
  353. echo -e ""
  354. echo -e "Useful port diagnostic command:"
  355. echo -e "netstat -atunp | grep starbound"
  356. echo -e ""
  357. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  358. echo -e "> Game\tINBOUND\t${port}\ttcp" >> .fn_details_ports
  359. echo -e "> Query\tINBOUND\t${queryport}\ttcp" >> .fn_details_ports
  360. echo -e "> Rcon\tINBOUND\t${rconport}\ttcp" >> .fn_details_ports
  361. column -s $'\t' -t .fn_details_ports
  362. rm -f .fn_details_ports
  363. fn_details_statusbottom
  364. }
  365. fn_details_teamspeak3(){
  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 parameters in"
  378. echo -e "${servercfgfullpath}."
  379. echo -e ""
  380. echo -e "Useful port diagnostic command:"
  381. echo -e "netstat -atunp | grep ts3server"
  382. echo -e ""
  383. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  384. echo -e "> Voice\tINBOUND\t${port}\tudp" >> .fn_details_ports
  385. echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp" >> .fn_details_ports
  386. echo -e "> File transfer\tINBOUND\t${fileport}\ttcp" >> .fn_details_ports
  387. column -s $'\t' -t .fn_details_ports
  388. rm -f .fn_details_ports
  389. fn_details_statusbottom
  390. }
  391. fn_details_unity3d(){
  392. fn_check_ip
  393. pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
  394. fn_parms
  395. fn_details_config
  396. fn_details_distro
  397. fn_details_os
  398. fn_details_performance
  399. fn_details_disk
  400. fn_details_gameserver
  401. fn_details_backup
  402. fn_details_commandlineparms
  403. echo -e ""
  404. echo -e "\e[92mPorts\e[0m"
  405. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  406. echo -e "Change ports by editing the parameters in"
  407. echo -e "${servercfgfullpath}."
  408. echo -e ""
  409. echo -e "Useful port diagnostic command:"
  410. echo -e "netstat -atunp | grep 7DaysToDie"
  411. echo -e ""
  412. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  413. echo -e "> Game/RCON\tINBOUND\t${port}\tudp" >> .fn_details_ports
  414. echo -e "> Query\tINBOUND\t${queryport}\tudp" >> .fn_details_ports
  415. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp" >> .fn_details_ports
  416. echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp" >> .fn_details_ports
  417. column -s $'\t' -t .fn_details_ports
  418. rm -f .fn_details_ports
  419. echo -e ""
  420. echo -e "\e[92m${servername} WebAdmin\e[0m"
  421. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  422. echo -e "\e[34mWebAdmin enabled:\t\e[0m${webadminenabled}" >> .fn_details_ports
  423. echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}" >> .fn_details_ports
  424. echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}" >> .fn_details_ports
  425. column -s $'\t' -t .fn_details_ports
  426. rm -f .fn_details_ports
  427. echo -e ""
  428. echo -e "\e[92m${servername} Telnet\e[0m"
  429. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  430. echo -e "\e[34mTelnet enabled:\t\e[0m${telnetenabled}" >> .fn_details_ports
  431. echo -e "\e[34mTelnet address:\t\e[0m${ip} ${telnetport}" >> .fn_details_ports
  432. echo -e "\e[34mTelnet password:\t\e[0m${telnetpass}" >> .fn_details_ports
  433. column -s $'\t' -t .fn_details_ports
  434. rm -f .fn_details_ports
  435. fn_details_statusbottom
  436. }
  437. fn_details_unreal(){
  438. fn_check_ip
  439. pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
  440. fn_parms
  441. fn_details_config
  442. fn_details_distro
  443. fn_details_os
  444. fn_details_performance
  445. fn_details_disk
  446. fn_details_gameserver
  447. fn_details_backup
  448. fn_details_commandlineparms
  449. echo -e ""
  450. echo -e "\e[92mPorts\e[0m"
  451. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  452. echo -e "Change ports by editing the parameters in"
  453. echo -e "${servercfgfullpath}."
  454. echo -e ""
  455. echo -e "Useful port diagnostic command:"
  456. echo -e "netstat -atunp | grep ucc-bin"
  457. echo -e ""
  458. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE" >> .fn_details_ports
  459. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}" >> .fn_details_ports
  460. echo -e "> Query\tINBOUND\t${queryport}\tudp" >> .fn_details_ports
  461. if [ "${engine}" == "unreal" ]; then
  462. echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp" >> .fn_details_ports
  463. fi
  464. if [ "${engine}" != "unreal" ] && [ "${appid}" != "223250" ]; then
  465. echo -e "> GameSpy query\tINBOUND\t${gsqueryport}\tudp\tOldQueryPortNumber=${gsqueryport}" >> .fn_details_ports
  466. fi
  467. if [ "${appid}" == "215360" ]; then
  468. echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp" >> .fn_details_ports
  469. else
  470. echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp" >> .fn_details_ports
  471. fi
  472. if [ "${appid}" ]; then
  473. if [ "${appid}" == "223250" ]; then
  474. echo -e "< Steam\tOUTBOUND\t20610\tudp" >> .fn_details_ports
  475. else
  476. echo -e "< Steam\tOUTBOUND\t20660\tudp" >> .fn_details_ports
  477. fi
  478. fi
  479. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" >> .fn_details_ports
  480. column -s $'\t' -t .fn_details_ports
  481. rm -f .fn_details_ports
  482. echo -e ""
  483. echo -e "\e[92m${servername} WebAdmin\e[0m"
  484. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  485. echo -e "\e[34mWebAdmin enabled:\t\e[0m${webadminenabled}" >> .fn_details_ports
  486. echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}" >> .fn_details_ports
  487. echo -e "\e[34mWebAdmin user:\t\e[0m${webadminuser}" >> .fn_details_ports
  488. echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}" >> .fn_details_ports
  489. column -s $'\t' -t .fn_details_ports
  490. rm -f .fn_details_ports
  491. fn_details_statusbottom
  492. }
  493. if [ ! -e ${servercfgfullpath} ]; then
  494. echo ""
  495. fn_printwarnnl "\e[0;31mCONFIGURATION FILE MISSING!\e[0m"
  496. echo "${servercfgfullpath}"
  497. echo "Some details cannot be displayed"
  498. echo -en ".\r"
  499. sleep 1
  500. echo -en "..\r"
  501. sleep 1
  502. echo -en "...\r"
  503. sleep 1
  504. echo -en " \r"
  505. fi
  506. if [ "${engine}" == "avalanche" ]; then
  507. fn_details_avalanche
  508. elif [ "${engine}" == "dontstarve" ]; then
  509. fn_details_dontstarve
  510. elif [ "${engine}" == "projectzomboid" ]; then
  511. fn_details_projectzomboid
  512. elif [ "${engine}" == "realvirtuality" ]; then
  513. fn_details_realvirtuality
  514. elif [ "${engine}" == "seriousengine35" ]; then
  515. fn_details_seriousengine35
  516. elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
  517. fn_details_source
  518. elif [ "${engine}" == "spark" ]; then
  519. fn_details_spark
  520. elif [ "${engine}" == "starbound" ]; then
  521. fn_details_starbound
  522. elif [ "${engine}" == "unity3d" ]; then
  523. fn_details_unity3d
  524. elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
  525. fn_details_unreal
  526. elif [ "${gamename}" == "Teamspeak 3" ]; then
  527. fn_details_teamspeak3
  528. else
  529. fn_printerrornl "Unable to detect server engine."
  530. fi