fn_details 20 KB

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