fn_details 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. #!/bin/bash
  2. # LGSM fn_details function
  3. # Author: Daniel Gibbs
  4. # Website: http://gameservermanagers.com
  5. # Version: 210715
  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. ## server details
  55. echo -e "\e[92m${gamename} Server Details\e[0m"
  56. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  57. # server name
  58. echo -e "\e[34mServer name:\t\e[0m${servername}" >> .fn_details_gameserver
  59. # server ip
  60. echo -e "\e[34mServer IP:\t\e[0m${ip}:${port}" >> .fn_details_gameserver
  61. # rcon password
  62. if [ -n "${rcon}" ]; then
  63. echo -e "\e[34mRCON password:\t\e[0m${rcon}" >> .fn_details_gameserver
  64. fi
  65. # server password
  66. if [ -n "${serverpassword}" ]; then
  67. echo -e "\e[34mServer password:\t\e[0m${serverpassword}" >> .fn_details_gameserver
  68. fi
  69. # admin password
  70. if [ -n "${adminpassword}" ]; then
  71. echo -e "\e[34mAdmin password:\t\e[0m${adminpassword}" >> .fn_details_gameserver
  72. fi
  73. # slots
  74. if [ -n "${slots}" ]; then
  75. echo -e "\e[34mSlots:\t\e[0m${slots}" >> .fn_details_gameserver
  76. fi
  77. # game mode
  78. if [ -n "${gamemode}" ]; then
  79. echo -e "\e[34mGame Mode:\t\e[0m${gamemode}" >> .fn_details_gameserver
  80. fi
  81. # tick rate
  82. if [ -n "${tickrate}" ]; then
  83. echo -e "\e[34mTick rate:\t\e[0m${tickrate}" >> .fn_details_gameserver
  84. fi
  85. # online status
  86. if [ "${gamename}" == "Teamspeak 3" ]; then
  87. fn_check_ts3status
  88. if [ "${ts3status}" = "Server seems to have died" ] || [ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then
  89. echo -e "\e[34mStatus:\t\e[0;31mOFFLINE\e[0m" >> .fn_details_gameserver
  90. else
  91. echo -e "\e[34mStatus:\t\e[0;32mONLINE\e[0m" >> .fn_details_gameserver
  92. fi
  93. else
  94. pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
  95. if [ "${pid}" == "0" ]; then
  96. echo -e "\e[34mStatus:\t\e[0;31mOFFLINE\e[0m" >> .fn_details_gameserver
  97. else
  98. echo -e "\e[34mStatus:\t\e[0;32mONLINE\e[0m" >> .fn_details_gameserver
  99. fi
  100. fi
  101. # teamspeak dbplugin
  102. if [ -n "${dbplugin}" ]; then
  103. echo -e "\e[34mdbplugin:\t\e[0m${dbplugin}" >> .fn_details_gameserver
  104. fi
  105. column -s $'\t' -t .fn_details_gameserver
  106. rm -f .fn_details_gameserver
  107. echo -e ""
  108. ## script details
  109. echo -e "\e[92m${selfname} Script Details\e[0m"
  110. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  111. # service name
  112. echo -e "\e[34mService name:\t\e[0m${servicename}" >> .fn_details_gameserver
  113. # script version
  114. if [ -n "${version}" ]; then
  115. echo -e "\e[34m${selfname} version:\t\e[0m${version}" >> .fn_details_gameserver
  116. fi
  117. # script user
  118. echo -e "\e[34mUser:\t\e[0m$(whoami)" >> .fn_details_gameserver
  119. # GLIBC required
  120. if [ -n "${glibcrequired}" ]; then
  121. 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
  122. if [ "${glibcfix}" == "yes" ]; then
  123. echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired} \e[0m(\e[0;32mUsing GLIBC fix\e[0m)" >> .fn_details_gameserver
  124. else
  125. echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired}\e[0m(\e[0;32mGLIBC version too old\e[0m)" >> .fn_details_gameserver
  126. fi
  127. else
  128. echo -e "\e[34mGLIBC required:\t\e[0;32m${glibcrequired}\e[0m" >> .fn_details_gameserver
  129. fi
  130. fi
  131. # email notification
  132. if [ -n "${emailnotification}" ]; then
  133. echo -e "\e[34mEmail notification:\t\e[0m${emailnotification}" >> .fn_details_gameserver
  134. fi
  135. # update on start
  136. if [ -n "${updateonstart}" ]; then
  137. echo -e "\e[34mUpdate on start:\t\e[0m${updateonstart}" >> .fn_details_gameserver
  138. fi
  139. # script location
  140. echo -e "\e[34mLocation:\t\e[0m${rootdir}" >> .fn_details_gameserver
  141. # config file location
  142. if [ -n "${servercfgfullpath}" ]; then
  143. echo -e "\e[34mConfig file:\t\e[0m${servercfgfullpath}" >> .fn_details_gameserver
  144. fi
  145. # network config file location (ARMA 3)
  146. if [ -n "${networkcfgfullpath}" ]; then
  147. echo -e "\e[34mNetwork config file:\t\e[0m${networkcfgfullpath}" >> .fn_details_gameserver
  148. fi
  149. column -s $'\t' -t .fn_details_gameserver
  150. rm -f .fn_details_gameserver
  151. }
  152. fn_details_backup(){
  153. echo -e ""
  154. echo -e "\e[92mBackups\e[0m"
  155. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  156. if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
  157. echo -e "No Backups created"
  158. else
  159. echo -e "\e[34mNo. of backups:\t\e[0m${backupcount}" >> .fn_details_backup
  160. echo -e "\e[34mLatest backup:\e[0m" >> .fn_details_backup
  161. echo -e "\e[34m date:\t\e[0m${lastbackupdate}" >> .fn_details_backup
  162. echo -e "\e[34m file:\t\e[0m${lastbackup}" >> .fn_details_backup
  163. echo -e "\e[34m size:\t\e[0m${lastbackupsize}" >> .fn_details_backup
  164. column -s $'\t' -t .fn_details_backup
  165. rm -f .fn_details_backup
  166. fi
  167. }
  168. fn_details_commandlineparms(){
  169. echo -e ""
  170. echo -e "\e[92mCommand-line Parameters\e[0m"
  171. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  172. echo -e "${executable} ${parms}"
  173. }
  174. fn_details_statusbottom(){
  175. echo -e ""
  176. if [ "${gamename}" == "Teamspeak 3" ]; then
  177. if [ "${ts3status}" = "Server seems to have died" ] || [ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then
  178. echo -e "\e[34mStatus: \e[0;31mOFFLINE\e[0m"
  179. else
  180. echo -e "\e[34mStatus: \e[0;32mONLINE\e[0m"
  181. fi
  182. else
  183. if [ "${pid}" == "0" ]; then
  184. echo -e "\e[34mStatus: \e[0;31mOFFLINE\e[0m"
  185. else
  186. echo -e "\e[34mStatus: \e[0;32mONLINE\e[0m"
  187. fi
  188. fi
  189. echo -e ""
  190. }
  191. # Engine Specific details
  192. fn_details_avalanche(){
  193. fn_check_ip
  194. fn_details_config
  195. fn_details_distro
  196. fn_details_os
  197. fn_details_performance
  198. fn_details_disk
  199. fn_details_gameserver
  200. fn_details_backup
  201. pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
  202. echo -e ""
  203. echo -e "\e[92mPorts\e[0m"
  204. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  205. echo -e "Change ports by editing the parameters in"
  206. echo -e "${servercfgfullpath}."
  207. echo -e ""
  208. echo -e "Useful port diagnostic command:"
  209. echo -e "netstat -atunp | grep Jcmp-Server"
  210. echo -e ""
  211. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  212. echo -e "> Game\tINBOUND\t${port}\tudp" >> .fn_details_ports
  213. column -s $'\t' -t .fn_details_ports
  214. rm -f .fn_details_ports
  215. fn_details_statusbottom
  216. }
  217. fn_details_dontstarve(){
  218. fn_check_ip
  219. fn_details_config
  220. fn_details_distro
  221. fn_details_os
  222. fn_details_performance
  223. fn_details_disk
  224. fn_details_gameserver
  225. fn_details_backup
  226. pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
  227. echo -e ""
  228. echo -e "\e[92mPorts\e[0m"
  229. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  230. echo -e "Change ports by editing the parameters in"
  231. echo -e "${servercfgfullpath}."
  232. echo -e ""
  233. echo -e "Useful port diagnostic command:"
  234. echo -e "netstat -atunp | grep dontstarve"
  235. echo -e ""
  236. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  237. echo -e "> Game\tINBOUND\t${port}\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_projectzomboid(){
  243. fn_check_ip
  244. fn_details_config
  245. fn_details_distro
  246. fn_details_os
  247. fn_details_performance
  248. fn_details_disk
  249. fn_details_gameserver
  250. fn_details_backup
  251. pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
  252. echo -e ""
  253. echo -e "\e[92mPorts\e[0m"
  254. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  255. echo -e "Change ports by editing the parameters in"
  256. echo -e "${servercfgfullpath}."
  257. echo -e ""
  258. echo -e "Useful port diagnostic command:"
  259. echo -e "netstat -atunp | grep java"
  260. echo -e ""
  261. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  262. echo -e "> Game\tINBOUND\t${port}\tudp" >> .fn_details_ports
  263. column -s $'\t' -t .fn_details_ports
  264. rm -f .fn_details_ports
  265. fn_details_statusbottom
  266. }
  267. fn_details_realvirtuality(){
  268. fn_check_ip
  269. pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
  270. fn_parms
  271. fn_details_config
  272. fn_details_distro
  273. fn_details_os
  274. fn_details_performance
  275. fn_details_disk
  276. fn_details_gameserver
  277. fn_details_backup
  278. fn_details_commandlineparms
  279. echo -e ""
  280. echo -e "\e[92mPorts\e[0m"
  281. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  282. echo -e "Change ports by editing the parameters in"
  283. echo -e "${servercfgfullpath}."
  284. echo -e ""
  285. echo -e "Useful port diagnostic command:"
  286. echo -e "netstat -atunp | grep arma3server"
  287. echo -e ""
  288. if [ -z ${port} ] || [ -z ${queryport} ] || [ -z ${masterport} ] ; then
  289. echo -e "\e[0;31mERROR!\e[0m Missing/commented ports in ${servercfg}."
  290. echo -e ""
  291. fi
  292. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  293. echo -e "> Game\tINBOUND\t${port}\tudp" >> .fn_details_ports
  294. echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp" >> .fn_details_ports
  295. echo -e "> Steam: Master traffic\tINBOUND\t${masterport}\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_seriousengine35(){
  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 parameters in"
  316. echo -e "${servercfgfullpath}."
  317. echo -e ""
  318. echo -e "Useful port diagnostic command:"
  319. echo -e "netstat -atunp | grep Sam3_Dedicate"
  320. echo -e ""
  321. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  322. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp" >> .fn_details_ports
  323. echo -e "> Query\tINBOUND\t${queryport}\tudp" >> .fn_details_ports
  324. column -s $'\t' -t .fn_details_ports
  325. rm -f .fn_details_ports
  326. fn_details_statusbottom
  327. }
  328. fn_details_source(){
  329. fn_check_ip
  330. fn_parms
  331. fn_details_config
  332. fn_details_distro
  333. fn_details_os
  334. fn_details_performance
  335. fn_details_disk
  336. fn_details_gameserver
  337. fn_details_backup
  338. fn_details_commandlineparms
  339. echo -e ""
  340. echo -e "\e[92mPorts\e[0m"
  341. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  342. echo -e "Change ports by editing the command-line"
  343. echo -e "parameters in ${selfname}."
  344. echo -e ""
  345. echo -e "Useful port diagnostic command:"
  346. echo -e "netstat -atunp | grep srcds_linux"
  347. echo -e ""
  348. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  349. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp" >> .fn_details_ports
  350. if [ -n "${sourcetvport}" ]; then
  351. echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp" >> .fn_details_ports
  352. fi
  353. echo -e "< Client\tOUTBOUND\t${clientport}\tudp" >> .fn_details_ports
  354. column -s $'\t' -t .fn_details_ports
  355. rm -f .fn_details_ports
  356. fn_details_statusbottom
  357. }
  358. fn_details_spark(){
  359. fn_check_ip
  360. pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
  361. fn_parms
  362. fn_details_config
  363. fn_details_distro
  364. fn_details_os
  365. fn_details_performance
  366. fn_details_disk
  367. fn_details_gameserver
  368. fn_details_backup
  369. fn_details_commandlineparms
  370. echo -e ""
  371. echo -e "\e[92mPorts\e[0m"
  372. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  373. echo -e "Change ports by editing the command-line"
  374. echo -e "parameters in ${selfname}."
  375. echo -e ""
  376. echo -e "Useful port diagnostic command:"
  377. echo -e "netstat -atunp | grep server_linux3"
  378. echo -e ""
  379. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  380. echo -e "> Game/RCON\tINBOUND\t${port}\tudp" >> .fn_details_ports
  381. echo -e "> Query\tINBOUND\t${queryport}\tudp" >> .fn_details_ports
  382. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp" >> .fn_details_ports
  383. column -s $'\t' -t .fn_details_ports
  384. rm -f .fn_details_ports
  385. echo -e ""
  386. echo -e "\e[92m${servername} WebAdmin\e[0m"
  387. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  388. echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}/index.html" >> .fn_details_ports
  389. echo -e "\e[34mWebAdmin username:\t\e[0m${webadminuser}" >> .fn_details_ports
  390. echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}" >> .fn_details_ports
  391. column -s $'\t' -t .fn_details_ports
  392. rm -f .fn_details_ports
  393. fn_details_statusbottom
  394. }
  395. fn_details_starbound(){
  396. fn_check_ip
  397. fn_parms
  398. fn_details_config
  399. fn_details_distro
  400. fn_details_os
  401. fn_details_performance
  402. fn_details_disk
  403. fn_details_gameserver
  404. fn_details_backup
  405. fn_details_commandlineparms
  406. echo -e ""
  407. echo -e "\e[92mPorts\e[0m"
  408. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  409. echo -e "Change ports by editing the command-line"
  410. echo -e "parameters in ${selfname}."
  411. echo -e ""
  412. echo -e "Useful port diagnostic command:"
  413. echo -e "netstat -atunp | grep starbound"
  414. echo -e ""
  415. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  416. echo -e "> Game\tINBOUND\t${port}\ttcp" >> .fn_details_ports
  417. echo -e "> Query\tINBOUND\t${queryport}\ttcp" >> .fn_details_ports
  418. echo -e "> Rcon\tINBOUND\t${rconport}\ttcp" >> .fn_details_ports
  419. column -s $'\t' -t .fn_details_ports
  420. rm -f .fn_details_ports
  421. fn_details_statusbottom
  422. }
  423. fn_details_teamspeak3(){
  424. fn_details_config
  425. fn_details_distro
  426. fn_details_os
  427. fn_details_performance
  428. fn_details_disk
  429. fn_details_gameserver
  430. fn_details_backup
  431. fn_details_commandlineparms
  432. echo -e ""
  433. echo -e "\e[92mPorts\e[0m"
  434. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  435. echo -e "Change ports by editing the parameters in"
  436. echo -e "${servercfgfullpath}."
  437. echo -e ""
  438. echo -e "Useful port diagnostic command:"
  439. echo -e "netstat -atunp | grep ts3server"
  440. echo -e ""
  441. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  442. echo -e "> Voice\tINBOUND\t${port}\tudp" >> .fn_details_ports
  443. echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp" >> .fn_details_ports
  444. echo -e "> File transfer\tINBOUND\t${fileport}\ttcp" >> .fn_details_ports
  445. column -s $'\t' -t .fn_details_ports
  446. rm -f .fn_details_ports
  447. fn_details_statusbottom
  448. }
  449. fn_details_unity3d(){
  450. fn_check_ip
  451. pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
  452. fn_parms
  453. fn_details_config
  454. fn_details_distro
  455. fn_details_os
  456. fn_details_performance
  457. fn_details_disk
  458. fn_details_gameserver
  459. fn_details_backup
  460. fn_details_commandlineparms
  461. echo -e ""
  462. echo -e "\e[92mPorts\e[0m"
  463. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  464. echo -e "Change ports by editing the parameters in"
  465. echo -e "${servercfgfullpath}."
  466. echo -e ""
  467. echo -e "Useful port diagnostic command:"
  468. echo -e "netstat -atunp | grep 7DaysToDie"
  469. echo -e ""
  470. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" >> .fn_details_ports
  471. echo -e "> Game/RCON\tINBOUND\t${port}\tudp" >> .fn_details_ports
  472. echo -e "> Query\tINBOUND\t${queryport}\tudp" >> .fn_details_ports
  473. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp" >> .fn_details_ports
  474. echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp" >> .fn_details_ports
  475. column -s $'\t' -t .fn_details_ports
  476. rm -f .fn_details_ports
  477. echo -e ""
  478. echo -e "\e[92m${servername} WebAdmin\e[0m"
  479. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  480. echo -e "\e[34mWebAdmin enabled:\t\e[0m${webadminenabled}" >> .fn_details_ports
  481. echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}" >> .fn_details_ports
  482. echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}" >> .fn_details_ports
  483. column -s $'\t' -t .fn_details_ports
  484. rm -f .fn_details_ports
  485. echo -e ""
  486. echo -e "\e[92m${servername} Telnet\e[0m"
  487. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  488. echo -e "\e[34mTelnet enabled:\t\e[0m${telnetenabled}" >> .fn_details_ports
  489. echo -e "\e[34mTelnet address:\t\e[0m${ip} ${telnetport}" >> .fn_details_ports
  490. echo -e "\e[34mTelnet password:\t\e[0m${telnetpass}" >> .fn_details_ports
  491. column -s $'\t' -t .fn_details_ports
  492. rm -f .fn_details_ports
  493. fn_details_statusbottom
  494. }
  495. fn_details_unreal(){
  496. fn_check_ip
  497. pid=$(tmux list-sessions 2>&1|awk '{print $1}'|grep -E "^${servicename}:"|wc -l)
  498. fn_parms
  499. fn_details_config
  500. fn_details_distro
  501. fn_details_os
  502. fn_details_performance
  503. fn_details_disk
  504. fn_details_gameserver
  505. fn_details_backup
  506. fn_details_commandlineparms
  507. echo -e ""
  508. echo -e "\e[92mPorts\e[0m"
  509. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  510. echo -e "Change ports by editing the parameters in"
  511. echo -e "${servercfgfullpath}."
  512. echo -e ""
  513. echo -e "Useful port diagnostic command:"
  514. echo -e "netstat -atunp | grep ucc-bin"
  515. echo -e ""
  516. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE" >> .fn_details_ports
  517. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}" >> .fn_details_ports
  518. echo -e "> Query\tINBOUND\t${queryport}\tudp" >> .fn_details_ports
  519. if [ "${engine}" == "unreal" ]; then
  520. echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp" >> .fn_details_ports
  521. fi
  522. if [ "${engine}" != "unreal" ] && [ "${appid}" != "223250" ]; then
  523. echo -e "> GameSpy query\tINBOUND\t${gsqueryport}\tudp\tOldQueryPortNumber=${gsqueryport}" >> .fn_details_ports
  524. fi
  525. if [ "${appid}" == "215360" ]; then
  526. echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp" >> .fn_details_ports
  527. else
  528. echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp" >> .fn_details_ports
  529. fi
  530. if [ "${appid}" ]; then
  531. if [ "${appid}" == "223250" ]; then
  532. echo -e "< Steam\tOUTBOUND\t20610\tudp" >> .fn_details_ports
  533. else
  534. echo -e "< Steam\tOUTBOUND\t20660\tudp" >> .fn_details_ports
  535. fi
  536. fi
  537. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" >> .fn_details_ports
  538. column -s $'\t' -t .fn_details_ports
  539. rm -f .fn_details_ports
  540. echo -e ""
  541. echo -e "\e[92m${servername} WebAdmin\e[0m"
  542. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  543. echo -e "\e[34mWebAdmin enabled:\t\e[0m${webadminenabled}" >> .fn_details_ports
  544. echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}" >> .fn_details_ports
  545. echo -e "\e[34mWebAdmin user:\t\e[0m${webadminuser}" >> .fn_details_ports
  546. echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}" >> .fn_details_ports
  547. column -s $'\t' -t .fn_details_ports
  548. rm -f .fn_details_ports
  549. fn_details_statusbottom
  550. }
  551. if [ ! -e ${servercfgfullpath} ]; then
  552. echo ""
  553. fn_printwarnnl "\e[0;31mCONFIGURATION FILE MISSING!\e[0m"
  554. echo "${servercfgfullpath}"
  555. echo "Some details cannot be displayed"
  556. echo -en ".\r"
  557. sleep 1
  558. echo -en "..\r"
  559. sleep 1
  560. echo -en "...\r"
  561. sleep 1
  562. echo -en " \r"
  563. fi
  564. fn_details_glibc
  565. if [ "${engine}" == "avalanche" ]; then
  566. fn_details_avalanche
  567. elif [ "${engine}" == "dontstarve" ]; then
  568. fn_details_dontstarve
  569. elif [ "${engine}" == "projectzomboid" ]; then
  570. fn_details_projectzomboid
  571. elif [ "${engine}" == "realvirtuality" ]; then
  572. fn_details_realvirtuality
  573. elif [ "${engine}" == "seriousengine35" ]; then
  574. fn_details_seriousengine35
  575. elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
  576. fn_details_source
  577. elif [ "${engine}" == "spark" ]; then
  578. fn_details_spark
  579. elif [ "${engine}" == "starbound" ]; then
  580. fn_details_starbound
  581. elif [ "${engine}" == "unity3d" ]; then
  582. fn_details_unity3d
  583. elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
  584. fn_details_unreal
  585. elif [ "${gamename}" == "Teamspeak 3" ]; then
  586. fn_details_teamspeak3
  587. else
  588. fn_printerrornl "Unable to detect server engine."
  589. fi