fn_details 19 KB

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