fn_details 20 KB

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