command_details.sh 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. #!/bin/bash
  2. # LGSM command_details.sh function
  3. # Author: Daniel Gibbs
  4. # Website: http://gameservermanagers.com
  5. lgsm_version="271215"
  6. # Description: Displays server infomation.
  7. function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  8. # Standard Details
  9. # This applies to all engines
  10. fn_details_os(){
  11. echo -e ""
  12. echo -e "\e[93mDistro Details\e[0m"
  13. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  14. {
  15. echo -e "\e[34mDistro:\t\e[0m${os}"
  16. echo -e "\e[34mArch:\t\e[0m${arch}"
  17. echo -e "\e[34mKernel:\t\e[0m${kernel}"
  18. echo -e "\e[34mHostname:\t\e[0m$HOSTNAME"
  19. echo -e "\e[34mtmux:\t\e[0m${tmuxv}"
  20. echo -e "\e[34mGLIBC:\t\e[0m${glibcv}"
  21. } | column -s $'\t' -t
  22. }
  23. fn_details_performance(){
  24. echo -e ""
  25. echo -e "\e[93mPerformance\e[0m"
  26. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  27. {
  28. echo -e "\e[34mUptime:\t\e[0m${days}d, ${hours}h, ${minutes}m"
  29. echo -e "\e[34mAvg Load:\t\e[0m${load}"
  30. } | column -s $'\t' -t
  31. echo -e ""
  32. {
  33. echo -e "\e[34mMem:\t\e[34mtotal\t used\t free\e[0m"
  34. echo -e "\e[34mPhysical:\t\e[0m${physmemtotal}\t${physmemused}\t${physmemfree}\e[0m"
  35. echo -e "\e[34mSwap:\t\e[0m${swaptotal}\t${swapused}\t${swapfree}\e[0m"
  36. } | column -s $'\t' -t
  37. }
  38. fn_details_disk(){
  39. echo -e ""
  40. echo -e "\e[93mStorage\e[0m"
  41. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  42. {
  43. echo -e "\e[34mFilesystem:\t\e[0m${filesystem}"
  44. echo -e "\e[34mTotal:\t\e[0m${totalspace}"
  45. echo -e "\e[34mUsed:\t\e[0m${usedspace}"
  46. echo -e "\e[34mAvailable:\t\e[0m${availspace}"
  47. echo -e "\e[34mServerfiles:\t\e[0m${filesdirdu}"
  48. if [ -d "${backupdir}" ]; then
  49. echo -e "\e[34mBackups:\t\e[0m${backupdirdu}"
  50. fi
  51. } | column -s $'\t' -t
  52. }
  53. fn_details_gameserver(){
  54. echo -e ""
  55. ## server details
  56. echo -e "\e[92m${gamename} Server Details\e[0m"
  57. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  58. {
  59. # server name
  60. echo -e "\e[34mServer name:\t\e[0m${servername}"
  61. # server ip
  62. echo -e "\e[34mServer IP:\t\e[0m${ip}:${port}"
  63. # rcon password
  64. if [ -n "${rconpassword}" ]; then
  65. echo -e "\e[34mRCON password:\t\e[0m${rconpassword}"
  66. fi
  67. # server password
  68. if [ -n "${serverpassword}" ]; then
  69. echo -e "\e[34mServer password:\t\e[0m${serverpassword}"
  70. fi
  71. # admin password
  72. if [ -n "${adminpassword}" ]; then
  73. echo -e "\e[34mAdmin password:\t\e[0m${adminpassword}"
  74. fi
  75. # slots
  76. if [ -n "${slots}" ]; then
  77. echo -e "\e[34mSlots:\t\e[0m${slots}"
  78. fi
  79. # game mode
  80. if [ -n "${gamemode}" ]; then
  81. echo -e "\e[34mGame mode:\t\e[0m${gamemode}"
  82. fi
  83. # game world
  84. if [ -n "${gameworld}" ]; then
  85. echo -e "\e[34mGame world:\t\e[0m${gameworld}"
  86. fi
  87. # tick rate
  88. if [ -n "${tickrate}" ]; then
  89. echo -e "\e[34mTick rate:\t\e[0m${tickrate}"
  90. fi
  91. # online status
  92. if [ "${gamename}" == "Teamspeak 3" ]; then
  93. info_ts3status.sh
  94. if [ "${ts3status}" = "Server seems to have died" ]||[ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then
  95. echo -e "\e[34mStatus:\t\e[0;31mOFFLINE\e[0m"
  96. else
  97. echo -e "\e[34mStatus:\t\e[0;32mONLINE\e[0m"
  98. fi
  99. else
  100. pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
  101. if [ "${pid}" == "0" ]; 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. fi
  107. # teamspeak dbplugin
  108. if [ -n "${dbplugin}" ]; then
  109. echo -e "\e[34mdbplugin:\t\e[0m${dbplugin}"
  110. fi
  111. } | column -s $'\t' -t
  112. echo -e ""
  113. ## script details
  114. echo -e "\e[92m${selfname} Script Details\e[0m"
  115. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  116. {
  117. # service name
  118. echo -e "\e[34mService name:\t\e[0m${servicename}"
  119. # script version
  120. if [ -n "${version}" ]; then
  121. echo -e "\e[34m${selfname} version:\t\e[0m${version}"
  122. fi
  123. # script user
  124. echo -e "\e[34mUser:\t\e[0m$(whoami)"
  125. # GLIBC required
  126. if [ -n "${glibcrequired}" ]; then
  127. 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
  128. if [ "${glibcfix}" == "yes" ]; then
  129. echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired} \e[0m(\e[0;32mUsing GLIBC fix\e[0m)"
  130. else
  131. echo -e "\e[34mGLIBC required:\t\e[0;31m${glibcrequired}\e[0m(\e[0;32mGLIBC version too old\e[0m)"
  132. fi
  133. else
  134. echo -e "\e[34mGLIBC required:\t\e[0;32m${glibcrequired}\e[0m"
  135. fi
  136. fi
  137. # email notification
  138. if [ -n "${emailnotification}" ]; then
  139. echo -e "\e[34mEmail notification:\t\e[0m${emailnotification}"
  140. fi
  141. # update on start
  142. if [ -n "${updateonstart}" ]; then
  143. echo -e "\e[34mUpdate on start:\t\e[0m${updateonstart}"
  144. fi
  145. # script location
  146. echo -e "\e[34mLocation:\t\e[0m${rootdir}"
  147. # config file location
  148. if [ -n "${servercfgfullpath}" ]; then
  149. echo -e "\e[34mConfig file:\t\e[0m${servercfgfullpath}"
  150. fi
  151. # network config file location (ARMA 3)
  152. if [ -n "${networkcfgfullpath}" ]; then
  153. echo -e "\e[34mNetwork config file:\t\e[0m${networkcfgfullpath}"
  154. fi
  155. } | column -s $'\t' -t
  156. }
  157. fn_details_backup(){
  158. echo -e ""
  159. echo -e "\e[92mBackups\e[0m"
  160. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  161. if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
  162. echo -e "No Backups created"
  163. else
  164. {
  165. echo -e "\e[34mNo. of backups:\t\e[0m${backupcount}"
  166. echo -e "\e[34mLatest backup:\e[0m"
  167. echo -e "\e[34m date:\t\e[0m${lastbackupdate}"
  168. echo -e "\e[34m file:\t\e[0m${lastbackup}"
  169. echo -e "\e[34m size:\t\e[0m${lastbackupsize}"
  170. } | column -s $'\t' -t
  171. fi
  172. }
  173. fn_details_commandlineparms(){
  174. echo -e ""
  175. echo -e "\e[92mCommand-line Parameters\e[0m"
  176. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  177. echo -e "${executable} ${parms}"
  178. }
  179. fn_details_statusbottom(){
  180. echo -e ""
  181. if [ "${gamename}" == "Teamspeak 3" ]; then
  182. if [ "${ts3status}" = "Server seems to have died" ]||[ "${ts3status}" = "No server running (ts3server.pid is missing)" ]; then
  183. echo -e "\e[34mStatus: \e[0;31mOFFLINE\e[0m"
  184. else
  185. echo -e "\e[34mStatus: \e[0;32mONLINE\e[0m"
  186. fi
  187. else
  188. pid=$(tmux list-sessions 2>&1 | awk '{print $1}' | grep -Ec "^${servicename}:")
  189. if [ "${pid}" == "0" ]; then
  190. echo -e "\e[34mStatus: \e[0;31mOFFLINE\e[0m"
  191. else
  192. echo -e "\e[34mStatus: \e[0;32mONLINE\e[0m"
  193. fi
  194. fi
  195. echo -e ""
  196. }
  197. # Engine Specific details
  198. fn_details_avalanche(){
  199. echo -e ""
  200. echo -e "\e[92mPorts\e[0m"
  201. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  202. echo -e "Change ports by editing the parameters in"
  203. echo -e "${servercfgfullpath}."
  204. echo -e ""
  205. echo -e "Useful port diagnostic command:"
  206. echo -e "netstat -atunp | grep Jcmp-Server"
  207. echo -e ""
  208. {
  209. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  210. echo -e "> Game\tINBOUND\t${port}\tudp"
  211. } | column -s $'\t' -t
  212. fn_details_statusbottom
  213. }
  214. fn_details_dontstarve(){
  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. {
  225. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  226. echo -e "> Game\tINBOUND\t${port}\tudp"
  227. } | column -s $'\t' -t
  228. fn_details_statusbottom
  229. }
  230. fn_details_projectzomboid(){
  231. echo -e ""
  232. echo -e "\e[92mPorts\e[0m"
  233. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  234. echo -e "Change ports by editing the parameters in"
  235. echo -e "${servercfgfullpath}."
  236. echo -e ""
  237. echo -e "Useful port diagnostic command:"
  238. echo -e "netstat -atunp | grep java"
  239. echo -e ""
  240. {
  241. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  242. echo -e "> Game\tINBOUND\t${port}\tudp"
  243. } | column -s $'\t' -t
  244. fn_details_statusbottom
  245. }
  246. fn_details_realvirtuality(){
  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 arma3server"
  255. echo -e ""
  256. if [ -z "${port}" ]||[ -z "${queryport}" ]||[ -z "${masterport}" ]; then
  257. echo -e "\e[0;31mERROR!\e[0m Missing/commented ports in ${servercfg}."
  258. echo -e ""
  259. fi
  260. {
  261. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  262. echo -e "> Game\tINBOUND\t${port}\tudp"
  263. echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp"
  264. echo -e "> Steam: Master traffic\tINBOUND\t${masterport}\tudp"
  265. } | column -s $'\t' -t
  266. fn_details_statusbottom
  267. }
  268. fn_details_seriousengine35(){
  269. echo -e ""
  270. echo -e "\e[92mPorts\e[0m"
  271. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  272. echo -e "Change ports by editing the parameters in"
  273. echo -e "${servercfgfullpath}."
  274. echo -e ""
  275. echo -e "Useful port diagnostic command:"
  276. echo -e "netstat -atunp | grep Sam3_Dedicate"
  277. echo -e ""
  278. {
  279. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  280. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp"
  281. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  282. } | column -s $'\t' -t
  283. fn_details_statusbottom
  284. }
  285. fn_details_source(){
  286. echo -e ""
  287. echo -e "\e[92mPorts\e[0m"
  288. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  289. echo -e "Change ports by editing the command-line"
  290. echo -e "parameters in ${selfname}."
  291. echo -e ""
  292. echo -e "Useful port diagnostic command:"
  293. echo -e "netstat -atunp | grep srcds_linux"
  294. echo -e ""
  295. {
  296. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  297. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  298. if [ -n "${sourcetvport}" ]; then
  299. echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp"
  300. fi
  301. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  302. } | column -s $'\t' -t
  303. fn_details_statusbottom
  304. }
  305. fn_details_spark(){
  306. echo -e ""
  307. echo -e "\e[92mPorts\e[0m"
  308. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  309. echo -e "Change ports by editing the command-line"
  310. echo -e "parameters in ${selfname}."
  311. echo -e ""
  312. echo -e "Useful port diagnostic command:"
  313. echo -e "netstat -atunp | grep server_linux3"
  314. echo -e ""
  315. {
  316. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  317. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  318. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  319. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  320. } | column -s $'\t' -t
  321. echo -e ""
  322. echo -e "\e[92m${servername} WebAdmin\e[0m"
  323. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  324. {
  325. echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}/index.html"
  326. echo -e "\e[34mWebAdmin username:\t\e[0m${webadminuser}"
  327. echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}"
  328. } | column -s $'\t' -t
  329. fn_details_statusbottom
  330. }
  331. fn_details_starbound(){
  332. echo -e ""
  333. echo -e "\e[92mPorts\e[0m"
  334. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  335. echo -e "Change ports by editing the command-line"
  336. echo -e "parameters in ${selfname}."
  337. echo -e ""
  338. echo -e "Useful port diagnostic command:"
  339. echo -e "netstat -atunp | grep starbound"
  340. echo -e ""
  341. {
  342. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  343. echo -e "> Game\tINBOUND\t${port}\ttcp"
  344. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  345. echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
  346. } | column -s $'\t' -t
  347. fn_details_statusbottom
  348. }
  349. fn_details_teamspeak3(){
  350. echo -e ""
  351. echo -e "\e[92mPorts\e[0m"
  352. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  353. echo -e "Change ports by editing the parameters in"
  354. echo -e "${servercfgfullpath}."
  355. echo -e ""
  356. echo -e "Useful port diagnostic command:"
  357. echo -e "netstat -atunp | grep ts3server"
  358. echo -e ""
  359. {
  360. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  361. echo -e "> Voice\tINBOUND\t${port}\tudp"
  362. echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp"
  363. echo -e "> File transfer\tINBOUND\t${fileport}\ttcp"
  364. } | column -s $'\t' -t
  365. fn_details_statusbottom
  366. }
  367. fn_details_teeworlds(){
  368. echo -e ""
  369. echo -e "\e[92mPorts\e[0m"
  370. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  371. echo -e "Change ports by editing the command-line"
  372. echo -e "parameters in ${servercfgfullpath}."
  373. echo -e ""
  374. echo -e "Useful port diagnostic command:"
  375. echo -e "netstat -atunp | grep teeworlds_srv"
  376. echo -e ""
  377. {
  378. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  379. echo -e "> Game\tINBOUND\t${port}\ttcp"
  380. } | column -s $'\t' -t
  381. fn_details_statusbottom
  382. }
  383. fn_details_terraria(){
  384. echo -e ""
  385. echo -e "\e[92mPorts\e[0m"
  386. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  387. echo -e "Change ports by editing the command-line"
  388. echo -e "parameters in ${servercfgfullpath}."
  389. echo -e ""
  390. echo -e "Useful port diagnostic command:"
  391. echo -e "netstat -atunp | grep terraia"
  392. echo -e ""
  393. {
  394. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  395. echo -e "> Game\tINBOUND\t${port}\ttcp"
  396. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  397. echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
  398. } | column -s $'\t' -t
  399. fn_details_statusbottom
  400. }
  401. fn_details_sdtd(){
  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 parameters in"
  406. echo -e "${servercfgfullpath}."
  407. echo -e ""
  408. echo -e "Useful port diagnostic command:"
  409. echo -e "netstat -atunp | grep 7DaysToDie"
  410. echo -e ""
  411. {
  412. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  413. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  414. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  415. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  416. echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
  417. } | column -s $'\t' -t
  418. echo -e ""
  419. echo -e "\e[92m${servername} WebAdmin\e[0m"
  420. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  421. {
  422. echo -e "\e[34mWebAdmin enabled:\t\e[0m${webadminenabled}"
  423. echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}"
  424. echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}"
  425. } | column -s $'\t' -t
  426. echo -e ""
  427. echo -e "\e[92m${servername} Telnet\e[0m"
  428. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  429. {
  430. echo -e "\e[34mTelnet enabled:\t\e[0m${telnetenabled}"
  431. echo -e "\e[34mTelnet address:\t\e[0m${ip} ${telnetport}"
  432. echo -e "\e[34mTelnet password:\t\e[0m${telnetpass}"
  433. } | column -s $'\t' -t
  434. fn_details_statusbottom
  435. }
  436. fn_details_hurtworld(){
  437. echo -e ""
  438. echo -e "\e[92mPorts\e[0m"
  439. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  440. echo -e "Change ports by editing the parameters in"
  441. echo -e "hwserver script"
  442. echo -e ""
  443. echo -e "Useful port diagnostic command:"
  444. echo -e "netstat -atunp | grep Hurtworld"
  445. echo -e ""
  446. {
  447. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  448. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  449. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  450. } | column -s $'\t' -t
  451. echo -e ""
  452. fn_details_statusbottom
  453. }
  454. fn_details_unreal(){
  455. echo -e ""
  456. echo -e "\e[92mPorts\e[0m"
  457. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  458. echo -e "Change ports by editing the parameters in"
  459. echo -e "${servercfgfullpath}."
  460. echo -e ""
  461. echo -e "Useful port diagnostic command:"
  462. echo -e "netstat -atunp | grep ucc-bin"
  463. echo -e ""
  464. {
  465. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  466. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  467. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  468. if [ "${engine}" == "unreal" ]; then
  469. echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp"
  470. fi
  471. if [ "${engine}" != "unreal" ] && [ "${appid}" != "223250" ]; then
  472. echo -e "> GameSpy query\tINBOUND\t${gsqueryport}\tudp\tOldQueryPortNumber=${gsqueryport}"
  473. fi
  474. if [ "${appid}" == "215360" ]; then
  475. echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp"
  476. else
  477. echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp"
  478. fi
  479. if [ "${appid}" ]; then
  480. if [ "${appid}" == "223250" ]; then
  481. echo -e "< Steam\tOUTBOUND\t20610\tudp"
  482. else
  483. echo -e "< Steam\tOUTBOUND\t20660\tudp"
  484. fi
  485. fi
  486. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  487. } | column -s $'\t' -t
  488. echo -e ""
  489. echo -e "\e[92m${servername} WebAdmin\e[0m"
  490. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  491. {
  492. echo -e "\e[34mWebAdmin enabled:\t\e[0m${webadminenabled}"
  493. echo -e "\e[34mWebAdmin url:\t\e[0mhttp://${ip}:${webadminport}"
  494. echo -e "\e[34mWebAdmin username:\t\e[0m${webadminuser}"
  495. echo -e "\e[34mWebAdmin password:\t\e[0m${webadminpass}"
  496. } | column -s $'\t' -t
  497. fn_details_statusbottom
  498. }
  499. fn_details_ark(){
  500. echo -e ""
  501. echo -e "\e[92mPorts\e[0m"
  502. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  503. echo -e "Change ports by editing the parameters in"
  504. echo -e "${servercfgfullpath}."
  505. echo -e ""
  506. echo -e "Useful port diagnostic command:"
  507. echo -e "netstat -atunp | grep ShooterGame"
  508. echo -e ""
  509. {
  510. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  511. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  512. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  513. } | column -s $'\t' -t
  514. fn_details_statusbottom
  515. }
  516. # Run checks and gathers details to display.
  517. check.sh
  518. if [ ! -e "${servercfgfullpath}" ]; then
  519. if [ "${gamename}" != "Hurtworld" ]; then
  520. echo ""
  521. fn_printwarnnl "\e[0;31mCONFIGURATION FILE MISSING!\e[0m"
  522. echo "${servercfgfullpath}"
  523. echo "Some details cannot be displayed"
  524. echo -en ".\r"
  525. sleep 1
  526. echo -en "..\r"
  527. sleep 1
  528. echo -en "...\r"
  529. sleep 1
  530. echo -en " \r"
  531. fi
  532. fi
  533. info_config.sh
  534. info_distro.sh
  535. info_glibc.sh
  536. fn_details_os
  537. fn_details_performance
  538. fn_details_gameserver
  539. fn_details_backup
  540. # Some game servers do not have parms.
  541. if [ "${gamename}" != "Teamspeak 3" ]||[ "${engine}" != "avalanche" ]||[ "${engine}" != "dontstarve" ]||[ "${engine}" == "projectzomboid" ]; then
  542. fn_parms
  543. fn_details_commandlineparms
  544. fi
  545. # Display details depending on game or engine.
  546. if [ "${engine}" == "avalanche" ]; then
  547. fn_details_avalanche
  548. elif [ "${engine}" == "dontstarve" ]; then
  549. fn_details_dontstarve
  550. elif [ "${engine}" == "projectzomboid" ]; then
  551. fn_details_projectzomboid
  552. elif [ "${engine}" == "realvirtuality" ]; then
  553. fn_details_realvirtuality
  554. elif [ "${engine}" == "seriousengine35" ]; then
  555. fn_details_seriousengine35
  556. elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
  557. fn_details_source
  558. elif [ "${engine}" == "spark" ]; then
  559. fn_details_spark
  560. elif [ "${engine}" == "starbound" ]; then
  561. fn_details_starbound
  562. elif [ "${engine}" == "teeworlds" ]; then
  563. fn_details_teeworlds
  564. elif [ "${engine}" == "terraria" ]; then
  565. fn_details_terraria
  566. elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
  567. fn_details_unreal
  568. elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
  569. fn_details_ark
  570. elif [ "${gamename}" == "Hurtworld" ]; then
  571. fn_details_hurtworld
  572. elif [ "${gamename}" == "7 Days To Die" ]; then
  573. fn_details_sdtd
  574. elif [ "${gamename}" == "Teamspeak 3" ]; then
  575. fn_details_teamspeak3
  576. else
  577. fn_printerrornl "Unable to detect server engine."
  578. fi