4
0

fn_details 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  1. #!/bin/bash
  2. # LGSM fn_details function
  3. # Author: Daniel Gibbs
  4. # Website: http://gameservermanagers.com
  5. # Version: 281015
  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. {
  14. echo -e "\e[34mDistro:\t\e[0m${os}"
  15. echo -e "\e[34mArch:\t\e[0m${arch}"
  16. echo -e "\e[34mKernel:\t\e[0m${kernel}"
  17. echo -e "\e[34mHostname:\t\e[0m$HOSTNAME"
  18. echo -e "\e[34mtmux:\t\e[0m${tmuxv}"
  19. echo -e "\e[34mGLIBC:\t\e[0m${glibcv}"
  20. } >> .fn_details_distro
  21. column -s $'\t' -t .fn_details_distro
  22. rm -f .fn_details_distro
  23. }
  24. fn_details_performance(){
  25. echo -e ""
  26. echo -e "\e[93mPerformance\e[0m"
  27. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  28. {
  29. echo -e "\e[34mUptime:\t\e[0m${days}d, ${hours}h, ${minutes}m"
  30. echo -e "\e[34mAvg Load:\t\e[0m${load}"
  31. } >> .fn_details_performance
  32. column -s $'\t' -t .fn_details_performance
  33. rm -f .fn_details_performance
  34. echo -e ""
  35. {
  36. echo -e "\e[34mMem:\t\e[34mtotal\t used\t free\e[0m"
  37. echo -e "\e[34mPhysical:\t\e[0m${physmemtotal}\t${physmemused}\t${physmemfree}\e[0m"
  38. echo -e "\e[34mSwap:\t\e[0m${swaptotal}\t${swapused}\t${swapfree}\e[0m"
  39. } >> .fn_details_performance
  40. column -s $'\t' -t .fn_details_performance
  41. rm -f .fn_details_performance
  42. }
  43. fn_details_disk(){
  44. echo -e ""
  45. echo -e "\e[93mStorage\e[0m"
  46. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  47. {
  48. echo -e "\e[34mFilesystem:\t\e[0m${filesystem}"
  49. echo -e "\e[34mTotal:\t\e[0m${totalspace}"
  50. echo -e "\e[34mUsed:\t\e[0m${usedspace}"
  51. echo -e "\e[34mAvailable:\t\e[0m${availspace}"
  52. echo -e "\e[34mServerfiles:\t\e[0m${serverfilesdu}"
  53. if [ -d "${backupdir}" ]; then
  54. echo -e "\e[34mBackups:\t\e[0m${backupdirdu}"
  55. fi
  56. } >> .fn_details_disk
  57. column -s $'\t' -t .fn_details_disk
  58. rm -f .fn_details_disk
  59. }
  60. fn_details_gameserver(){
  61. echo -e ""
  62. ## server details
  63. echo -e "\e[92m${gamename} Server Details\e[0m"
  64. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  65. {
  66. # server name
  67. echo -e "\e[34mServer name:\t\e[0m${servername}"
  68. # server ip
  69. echo -e "\e[34mServer IP:\t\e[0m${ip}:${port}"
  70. # rcon password
  71. if [ -n "${rconpassword}" ]; then
  72. echo -e "\e[34mRCON password:\t\e[0m${rconpassword}"
  73. fi
  74. # server password
  75. if [ -n "${serverpassword}" ]; then
  76. echo -e "\e[34mServer password:\t\e[0m${serverpassword}"
  77. fi
  78. # admin password
  79. if [ -n "${adminpassword}" ]; then
  80. echo -e "\e[34mAdmin password:\t\e[0m${adminpassword}"
  81. fi
  82. # slots
  83. if [ -n "${slots}" ]; then
  84. echo -e "\e[34mSlots:\t\e[0m${slots}"
  85. fi
  86. # game mode
  87. if [ -n "${gamemode}" ]; then
  88. echo -e "\e[34mGame mode:\t\e[0m${gamemode}"
  89. fi
  90. # game world
  91. if [ -n "${gameworld}" ]; then
  92. echo -e "\e[34mGame world:\t\e[0m${gameworld}"
  93. fi
  94. # tick rate
  95. if [ -n "${tickrate}" ]; then
  96. echo -e "\e[34mTick rate:\t\e[0m${tickrate}"
  97. fi
  98. # online status
  99. if [ "${gamename}" == "Teamspeak 3" ]; then
  100. fn_check_ts3status
  101. if [ "${ts3status}" = "Server seems to have died" ] || [ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then
  102. echo -e "\e[34mStatus:\t\e[0;31mOFFLINE\e[0m"
  103. else
  104. echo -e "\e[34mStatus:\t\e[0;32mONLINE\e[0m"
  105. fi
  106. else
  107. pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
  108. if [ "${pid}" == "0" ]; then
  109. echo -e "\e[34mStatus:\t\e[0;31mOFFLINE\e[0m"
  110. else
  111. echo -e "\e[34mStatus:\t\e[0;32mONLINE\e[0m"
  112. fi
  113. fi
  114. # teamspeak dbplugin
  115. if [ -n "${dbplugin}" ]; then
  116. echo -e "\e[34mdbplugin:\t\e[0m${dbplugin}"
  117. fi
  118. } >> .fn_details_gameserver
  119. column -s $'\t' -t .fn_details_gameserver
  120. rm -f .fn_details_gameserver
  121. echo -e ""
  122. ## script details
  123. echo -e "\e[92m${selfname} Script Details\e[0m"
  124. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  125. {
  126. # service name
  127. echo -e "\e[34mService name:\t\e[0m${servicename}"
  128. # script version
  129. if [ -n "${version}" ]; then
  130. echo -e "\e[34m${selfname} version:\t\e[0m${version}"
  131. fi
  132. # script user
  133. echo -e "\e[34mUser:\t\e[0m$(whoami)"
  134. # GLIBC required
  135. if [ -n "${glibcrequired}" ]; then
  136. 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
  137. if [ "${glibcfix}" == "yes" ]; then
  138. echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired} \e[0m(\e[0;32mUsing GLIBC fix\e[0m)"
  139. else
  140. echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired}\e[0m(\e[0;32mGLIBC version too old\e[0m)"
  141. fi
  142. else
  143. echo -e "\e[34mGLIBC required:\t\e[0;32m${glibcrequired}\e[0m"
  144. fi
  145. fi
  146. # email notification
  147. if [ -n "${emailnotification}" ]; then
  148. echo -e "\e[34mEmail notification:\t\e[0m${emailnotification}"
  149. fi
  150. # update on start
  151. if [ -n "${updateonstart}" ]; then
  152. echo -e "\e[34mUpdate on start:\t\e[0m${updateonstart}"
  153. fi
  154. # script location
  155. echo -e "\e[34mLocation:\t\e[0m${rootdir}"
  156. # config file location
  157. if [ -n "${servercfgfullpath}" ]; then
  158. echo -e "\e[34mConfig file:\t\e[0m${servercfgfullpath}"
  159. fi
  160. # network config file location (ARMA 3)
  161. if [ -n "${networkcfgfullpath}" ]; then
  162. echo -e "\e[34mNetwork config file:\t\e[0m${networkcfgfullpath}"
  163. fi
  164. } >> .fn_details_script
  165. column -s $'\t' -t .fn_details_script
  166. rm -f .fn_details_script
  167. }
  168. fn_details_backup(){
  169. echo -e ""
  170. echo -e "\e[92mBackups\e[0m"
  171. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  172. if [ ! -d "${backupdir}" ] || [ "${backupcount}" == "0" ]; then
  173. echo -e "No Backups created"
  174. else
  175. {
  176. echo -e "\e[34mNo. of backups:\t\e[0m${backupcount}"
  177. echo -e "\e[34mLatest backup:\e[0m"
  178. echo -e "\e[34m date:\t\e[0m${lastbackupdate}"
  179. echo -e "\e[34m file:\t\e[0m${lastbackup}"
  180. echo -e "\e[34m size:\t\e[0m${lastbackupsize}"
  181. } >> .fn_details_backup
  182. column -s $'\t' -t .fn_details_backup
  183. rm -f .fn_details_backup
  184. fi
  185. }
  186. fn_details_commandlineparms(){
  187. echo -e ""
  188. echo -e "\e[92mCommand-line Parameters\e[0m"
  189. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  190. echo -e "${executable} ${parms}"
  191. }
  192. fn_details_statusbottom(){
  193. echo -e ""
  194. if [ "${gamename}" == "Teamspeak 3" ]; then
  195. if [ "${ts3status}" = "Server seems to have died" ] || [ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then
  196. echo -e "\e[34mStatus: \e[0;31mOFFLINE\e[0m"
  197. else
  198. echo -e "\e[34mStatus: \e[0;32mONLINE\e[0m"
  199. fi
  200. else
  201. if [ "${pid}" == "0" ]; then
  202. echo -e "\e[34mStatus: \e[0;31mOFFLINE\e[0m"
  203. else
  204. echo -e "\e[34mStatus: \e[0;32mONLINE\e[0m"
  205. fi
  206. fi
  207. echo -e ""
  208. }
  209. # Engine Specific details
  210. fn_details_avalanche(){
  211. fn_check_ip
  212. fn_details_config
  213. fn_details_distro
  214. fn_details_os
  215. fn_details_performance
  216. fn_details_disk
  217. fn_details_gameserver
  218. fn_details_backup
  219. pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
  220. echo -e ""
  221. echo -e "\e[92mPorts\e[0m"
  222. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  223. echo -e "Change ports by editing the parameters in"
  224. echo -e "${servercfgfullpath}."
  225. echo -e ""
  226. echo -e "Useful port diagnostic command:"
  227. echo -e "netstat -atunp | grep Jcmp-Server"
  228. echo -e ""
  229. {
  230. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  231. echo -e "> Game\tINBOUND\t${port}\tudp"
  232. } >> .fn_details_ports
  233. column -s $'\t' -t .fn_details_ports
  234. rm -f .fn_details_ports
  235. fn_details_statusbottom
  236. }
  237. fn_details_dontstarve(){
  238. fn_check_ip
  239. fn_details_config
  240. fn_details_distro
  241. fn_details_os
  242. fn_details_performance
  243. fn_details_disk
  244. fn_details_gameserver
  245. fn_details_backup
  246. pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
  247. echo -e ""
  248. echo -e "\e[92mPorts\e[0m"
  249. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  250. echo -e "Change ports by editing the parameters in"
  251. echo -e "${servercfgfullpath}."
  252. echo -e ""
  253. echo -e "Useful port diagnostic command:"
  254. echo -e "netstat -atunp | grep dontstarve"
  255. echo -e ""
  256. {
  257. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  258. echo -e "> Game\tINBOUND\t${port}\tudp"
  259. } >> .fn_details_ports
  260. column -s $'\t' -t .fn_details_ports
  261. rm -f .fn_details_ports
  262. fn_details_statusbottom
  263. }
  264. fn_details_projectzomboid(){
  265. fn_check_ip
  266. fn_details_config
  267. fn_details_distro
  268. fn_details_os
  269. fn_details_performance
  270. fn_details_disk
  271. fn_details_gameserver
  272. fn_details_backup
  273. pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
  274. echo -e ""
  275. echo -e "\e[92mPorts\e[0m"
  276. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  277. echo -e "Change ports by editing the parameters in"
  278. echo -e "${servercfgfullpath}."
  279. echo -e ""
  280. echo -e "Useful port diagnostic command:"
  281. echo -e "netstat -atunp | grep java"
  282. echo -e ""
  283. {
  284. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  285. echo -e "> Game\tINBOUND\t${port}\tudp"
  286. } >> .fn_details_ports
  287. column -s $'\t' -t .fn_details_ports
  288. rm -f .fn_details_ports
  289. fn_details_statusbottom
  290. }
  291. fn_details_realvirtuality(){
  292. fn_check_ip
  293. pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
  294. fn_parms
  295. fn_details_config
  296. fn_details_distro
  297. fn_details_os
  298. fn_details_performance
  299. fn_details_disk
  300. fn_details_gameserver
  301. fn_details_backup
  302. fn_details_commandlineparms
  303. echo -e ""
  304. echo -e "\e[92mPorts\e[0m"
  305. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  306. echo -e "Change ports by editing the parameters in"
  307. echo -e "${servercfgfullpath}."
  308. echo -e ""
  309. echo -e "Useful port diagnostic command:"
  310. echo -e "netstat -atunp | grep arma3server"
  311. echo -e ""
  312. if [ -z "${port}" ] || [ -z "${queryport}" ] || [ -z "${masterport}" ]; then
  313. echo -e "\e[0;31mERROR!\e[0m Missing/commented ports in ${servercfg}."
  314. echo -e ""
  315. fi
  316. {
  317. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  318. echo -e "> Game\tINBOUND\t${port}\tudp"
  319. echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp"
  320. echo -e "> Steam: Master traffic\tINBOUND\t${masterport}\tudp"
  321. } >> .fn_details_ports
  322. column -s $'\t' -t .fn_details_ports
  323. rm -f .fn_details_ports
  324. fn_details_statusbottom
  325. }
  326. fn_details_seriousengine35(){
  327. fn_check_ip
  328. pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
  329. fn_parms
  330. fn_details_config
  331. fn_details_distro
  332. fn_details_os
  333. fn_details_performance
  334. fn_details_disk
  335. fn_details_gameserver
  336. fn_details_backup
  337. fn_details_commandlineparms
  338. echo -e ""
  339. echo -e "\e[92mPorts\e[0m"
  340. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  341. echo -e "Change ports by editing the parameters in"
  342. echo -e "${servercfgfullpath}."
  343. echo -e ""
  344. echo -e "Useful port diagnostic command:"
  345. echo -e "netstat -atunp | grep Sam3_Dedicate"
  346. echo -e ""
  347. {
  348. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  349. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp"
  350. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  351. } >> .fn_details_ports
  352. column -s $'\t' -t .fn_details_ports
  353. rm -f .fn_details_ports
  354. fn_details_statusbottom
  355. }
  356. fn_details_source(){
  357. fn_check_ip
  358. fn_parms
  359. fn_details_config
  360. fn_details_distro
  361. fn_details_os
  362. fn_details_performance
  363. fn_details_disk
  364. fn_details_gameserver
  365. fn_details_backup
  366. fn_details_commandlineparms
  367. echo -e ""
  368. echo -e "\e[92mPorts\e[0m"
  369. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  370. echo -e "Change ports by editing the command-line"
  371. echo -e "parameters in ${selfname}."
  372. echo -e ""
  373. echo -e "Useful port diagnostic command:"
  374. echo -e "netstat -atunp | grep srcds_linux"
  375. echo -e ""
  376. {
  377. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  378. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  379. if [ -n "${sourcetvport}" ]; then
  380. echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp"
  381. fi
  382. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  383. } >> .fn_details_ports
  384. column -s $'\t' -t .fn_details_ports
  385. rm -f .fn_details_ports
  386. fn_details_statusbottom
  387. }
  388. fn_details_spark(){
  389. fn_check_ip
  390. pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
  391. fn_parms
  392. fn_details_config
  393. fn_details_distro
  394. fn_details_os
  395. fn_details_performance
  396. fn_details_disk
  397. fn_details_gameserver
  398. fn_details_backup
  399. fn_details_commandlineparms
  400. echo -e ""
  401. echo -e "\e[92mPorts\e[0m"
  402. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  403. echo -e "Change ports by editing the command-line"
  404. echo -e "parameters in ${selfname}."
  405. echo -e ""
  406. echo -e "Useful port diagnostic command:"
  407. echo -e "netstat -atunp | grep server_linux3"
  408. echo -e ""
  409. {
  410. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  411. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  412. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  413. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  414. } >> .fn_details_ports
  415. column -s $'\t' -t .fn_details_ports
  416. rm -f .fn_details_ports
  417. echo -e ""
  418. echo -e "\e[92m${servername} WebAdmin\e[0m"
  419. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  420. {
  421. echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}/index.html"
  422. echo -e "\e[34mWebAdmin username:\t\e[0m${webadminuser}"
  423. echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}"
  424. } >> .fn_details_ports
  425. column -s $'\t' -t .fn_details_ports
  426. rm -f .fn_details_ports
  427. fn_details_statusbottom
  428. }
  429. fn_details_starbound(){
  430. fn_check_ip
  431. fn_parms
  432. fn_details_config
  433. fn_details_distro
  434. fn_details_os
  435. fn_details_performance
  436. fn_details_disk
  437. fn_details_gameserver
  438. fn_details_backup
  439. fn_details_commandlineparms
  440. echo -e ""
  441. echo -e "\e[92mPorts\e[0m"
  442. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  443. echo -e "Change ports by editing the command-line"
  444. echo -e "parameters in ${selfname}."
  445. echo -e ""
  446. echo -e "Useful port diagnostic command:"
  447. echo -e "netstat -atunp | grep starbound"
  448. echo -e ""
  449. {
  450. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  451. echo -e "> Game\tINBOUND\t${port}\ttcp"
  452. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  453. echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
  454. } >> .fn_details_ports
  455. column -s $'\t' -t .fn_details_ports
  456. rm -f .fn_details_ports
  457. fn_details_statusbottom
  458. }
  459. fn_details_teamspeak3(){
  460. fn_details_config
  461. fn_details_distro
  462. fn_details_os
  463. fn_details_performance
  464. fn_details_disk
  465. fn_details_gameserver
  466. fn_details_backup
  467. fn_details_commandlineparms
  468. echo -e ""
  469. echo -e "\e[92mPorts\e[0m"
  470. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  471. echo -e "Change ports by editing the parameters in"
  472. echo -e "${servercfgfullpath}."
  473. echo -e ""
  474. echo -e "Useful port diagnostic command:"
  475. echo -e "netstat -atunp | grep ts3server"
  476. echo -e ""
  477. {
  478. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  479. echo -e "> Voice\tINBOUND\t${port}\tudp"
  480. echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp"
  481. echo -e "> File transfer\tINBOUND\t${fileport}\ttcp"
  482. } >> .fn_details_ports
  483. column -s $'\t' -t .fn_details_ports
  484. rm -f .fn_details_ports
  485. fn_details_statusbottom
  486. }
  487. fn_details_teeworlds(){
  488. fn_check_ip
  489. fn_parms
  490. fn_details_config
  491. fn_details_distro
  492. fn_details_os
  493. fn_details_performance
  494. fn_details_disk
  495. fn_details_gameserver
  496. fn_details_backup
  497. fn_details_commandlineparms
  498. echo -e ""
  499. echo -e "\e[92mPorts\e[0m"
  500. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  501. echo -e "Change ports by editing the command-line"
  502. echo -e "parameters in ${servercfgfullpath}."
  503. echo -e ""
  504. echo -e "Useful port diagnostic command:"
  505. echo -e "netstat -atunp | grep teeworlds_srv"
  506. echo -e ""
  507. {
  508. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  509. echo -e "> Game\tINBOUND\t${port}\ttcp"
  510. } >> .fn_details_ports
  511. column -s $'\t' -t .fn_details_ports
  512. rm -f .fn_details_ports
  513. fn_details_statusbottom
  514. }
  515. fn_details_terraria(){
  516. fn_check_ip
  517. fn_parms
  518. fn_details_config
  519. fn_details_distro
  520. fn_details_os
  521. fn_details_performance
  522. fn_details_disk
  523. fn_details_gameserver
  524. fn_details_backup
  525. fn_details_commandlineparms
  526. echo -e ""
  527. echo -e "\e[92mPorts\e[0m"
  528. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  529. echo -e "Change ports by editing the command-line"
  530. echo -e "parameters in ${servercfgfullpath}."
  531. echo -e ""
  532. echo -e "Useful port diagnostic command:"
  533. echo -e "netstat -atunp | grep terraia"
  534. echo -e ""
  535. {
  536. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  537. echo -e "> Game\tINBOUND\t${port}\ttcp"
  538. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  539. echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
  540. } >> .fn_details_ports
  541. column -s $'\t' -t .fn_details_ports
  542. rm -f .fn_details_ports
  543. fn_details_statusbottom
  544. }
  545. fn_details_unity3d(){
  546. fn_check_ip
  547. pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
  548. fn_parms
  549. fn_details_config
  550. fn_details_distro
  551. fn_details_os
  552. fn_details_performance
  553. fn_details_disk
  554. fn_details_gameserver
  555. fn_details_backup
  556. fn_details_commandlineparms
  557. echo -e ""
  558. echo -e "\e[92mPorts\e[0m"
  559. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  560. echo -e "Change ports by editing the parameters in"
  561. echo -e "${servercfgfullpath}."
  562. echo -e ""
  563. echo -e "Useful port diagnostic command:"
  564. echo -e "netstat -atunp | grep 7DaysToDie"
  565. echo -e ""
  566. {
  567. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  568. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  569. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  570. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  571. echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
  572. } >> .fn_details_ports
  573. column -s $'\t' -t .fn_details_ports
  574. rm -f .fn_details_ports
  575. echo -e ""
  576. echo -e "\e[92m${servername} WebAdmin\e[0m"
  577. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  578. {
  579. echo -e "\e[34mWebAdmin enabled:\t\e[0m${webadminenabled}"
  580. echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}"
  581. echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}"
  582. } >> .fn_details_ports
  583. column -s $'\t' -t .fn_details_ports
  584. rm -f .fn_details_ports
  585. echo -e ""
  586. echo -e "\e[92m${servername} Telnet\e[0m"
  587. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  588. {
  589. echo -e "\e[34mTelnet enabled:\t\e[0m${telnetenabled}"
  590. echo -e "\e[34mTelnet address:\t\e[0m${ip} ${telnetport}"
  591. echo -e "\e[34mTelnet password:\t\e[0m${telnetpass}"
  592. } >> .fn_details_ports
  593. column -s $'\t' -t .fn_details_ports
  594. rm -f .fn_details_ports
  595. fn_details_statusbottom
  596. }
  597. fn_details_unreal(){
  598. fn_check_ip
  599. pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
  600. fn_parms
  601. fn_details_config
  602. fn_details_distro
  603. fn_details_os
  604. fn_details_performance
  605. fn_details_disk
  606. fn_details_gameserver
  607. fn_details_backup
  608. fn_details_commandlineparms
  609. echo -e ""
  610. echo -e "\e[92mPorts\e[0m"
  611. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  612. echo -e "Change ports by editing the parameters in"
  613. echo -e "${servercfgfullpath}."
  614. echo -e ""
  615. echo -e "Useful port diagnostic command:"
  616. echo -e "netstat -atunp | grep ucc-bin"
  617. echo -e ""
  618. {
  619. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  620. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  621. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  622. if [ "${engine}" == "unreal" ]; then
  623. echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp"
  624. fi
  625. if [ "${engine}" != "unreal" ] && [ "${appid}" != "223250" ]; then
  626. echo -e "> GameSpy query\tINBOUND\t${gsqueryport}\tudp\tOldQueryPortNumber=${gsqueryport}"
  627. fi
  628. if [ "${appid}" == "215360" ]; then
  629. echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp"
  630. else
  631. echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp"
  632. fi
  633. if [ "${appid}" ]; then
  634. if [ "${appid}" == "223250" ]; then
  635. echo -e "< Steam\tOUTBOUND\t20610\tudp"
  636. else
  637. echo -e "< Steam\tOUTBOUND\t20660\tudp"
  638. fi
  639. fi
  640. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  641. } >> .fn_details_ports
  642. column -s $'\t' -t .fn_details_ports
  643. rm -f .fn_details_ports
  644. echo -e ""
  645. echo -e "\e[92m${servername} WebAdmin\e[0m"
  646. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  647. {
  648. echo -e "\e[34mWebAdmin enabled:\t\e[0m${webadminenabled}"
  649. echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}"
  650. echo -e "\e[34mWebAdmin username:\t\e[0m${webadminuser}"
  651. echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}"
  652. } >> .fn_details_webadmin
  653. column -s $'\t' -t .fn_details_webadmin
  654. rm -f .fn_details_webadmin
  655. fn_details_statusbottom
  656. }
  657. fn_details_ark(){
  658. fn_check_ip
  659. pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
  660. fn_parms
  661. fn_details_config
  662. fn_details_distro
  663. fn_details_os
  664. fn_details_performance
  665. fn_details_disk
  666. fn_details_gameserver
  667. fn_details_backup
  668. fn_details_commandlineparms
  669. echo -e ""
  670. echo -e "\e[92mPorts\e[0m"
  671. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  672. echo -e "Change ports by editing the parameters in"
  673. echo -e "${servercfgfullpath}."
  674. echo -e ""
  675. echo -e "Useful port diagnostic command:"
  676. echo -e "netstat -atunp | grep ShooterGame"
  677. echo -e ""
  678. {
  679. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  680. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  681. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  682. } >> .fn_details_ports
  683. column -s $'\t' -t .fn_details_ports
  684. rm -f .fn_details_ports
  685. fn_details_statusbottom
  686. }
  687. if [ ! -e "${servercfgfullpath}" ]; then
  688. echo ""
  689. fn_printwarnnl "\e[0;31mCONFIGURATION FILE MISSING!\e[0m"
  690. echo "${servercfgfullpath}"
  691. echo "Some details cannot be displayed"
  692. echo -en ".\r"
  693. sleep 1
  694. echo -en "..\r"
  695. sleep 1
  696. echo -en "...\r"
  697. sleep 1
  698. echo -en " \r"
  699. fi
  700. fn_details_glibc
  701. if [ "${engine}" == "avalanche" ]; then
  702. fn_details_avalanche
  703. elif [ "${engine}" == "dontstarve" ]; then
  704. fn_details_dontstarve
  705. elif [ "${engine}" == "projectzomboid" ]; then
  706. fn_details_projectzomboid
  707. elif [ "${engine}" == "realvirtuality" ]; then
  708. fn_details_realvirtuality
  709. elif [ "${engine}" == "seriousengine35" ]; then
  710. fn_details_seriousengine35
  711. elif [ "${engine}" == "source" ] || [ "${engine}" == "goldsource" ]; then
  712. fn_details_source
  713. elif [ "${engine}" == "spark" ]; then
  714. fn_details_spark
  715. elif [ "${engine}" == "starbound" ]; then
  716. fn_details_starbound
  717. elif [ "${engine}" == "teeworlds" ]; then
  718. fn_details_teeworlds
  719. elif [ "${engine}" == "terraria" ]; then
  720. fn_details_terraria
  721. elif [ "${engine}" == "unity3d" ]; then
  722. fn_details_unity3d
  723. elif [ "${engine}" == "unreal" ] || [ "${engine}" == "unreal2" ]; then
  724. fn_details_unreal
  725. elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
  726. fn_details_ark
  727. elif [ "${gamename}" == "Teamspeak 3" ]; then
  728. fn_details_teamspeak3
  729. else
  730. fn_printerrornl "Unable to detect server engine."
  731. fi