4
0

fn_details 17 KB

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