fn_details 17 KB

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