fn_details 20 KB

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