info_messages.sh 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240
  1. #!/bin/bash
  2. # LinuxGSM info_messages.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://linuxgsm.com
  5. # Description: Defines server info messages for details and alerts.
  6. # Standard Details
  7. # This applies to all engines
  8. fn_info_message_head(){
  9. echo -e ""
  10. echo -e "${lightyellow}Summary${default}"
  11. fn_messages_separator
  12. echo -e "Message"
  13. echo -e "${alertbody}"
  14. echo -e ""
  15. echo -e "Game"
  16. echo -e "${gamename}"
  17. echo -e ""
  18. echo -e "Server name"
  19. echo -e "${servername}"
  20. echo -e ""
  21. echo -e "Hostname"
  22. echo -e "${HOSTNAME}"
  23. echo -e ""
  24. echo -e "Server IP"
  25. echo -e "${ip}:${port}"
  26. }
  27. fn_info_message_distro(){
  28. #
  29. # Distro Details
  30. # =====================================
  31. # Distro: Ubuntu 14.04.4 LTS
  32. # Arch: x86_64
  33. # Kernel: 3.13.0-79-generic
  34. # Hostname: hostname
  35. # tmux: tmux 1.8
  36. # GLIBC: 2.19
  37. echo -e ""
  38. echo -e "${lightyellow}Distro Details${default}"
  39. fn_messages_separator
  40. {
  41. echo -e "${blue}Distro:\t${default}${distroname}"
  42. echo -e "${blue}Arch:\t${default}${arch}"
  43. echo -e "${blue}Kernel:\t${default}${kernel}"
  44. echo -e "${blue}Hostname:\t${default}${HOSTNAME}"
  45. echo -e "${blue}tmux:\t${default}${tmuxv}"
  46. echo -e "${blue}GLIBC:\t${default}${glibcversion}"
  47. } | column -s $'\t' -t
  48. }
  49. fn_info_message_performance(){
  50. #
  51. # Performance
  52. # =====================================
  53. # Uptime: 55d, 3h, 38m
  54. # Avg Load: 1.00, 1.01, 0.78
  55. #
  56. # Mem: total used free cached
  57. # Physical: 741M 656M 85M 256M
  58. # Swap: 0B 0B 0B
  59. echo -e ""
  60. echo -e "${lightyellow}Performance${default}"
  61. {
  62. echo -e "${blue}Uptime:\t${default}${days}d, ${hours}h, ${minutes}m"
  63. echo -e "${blue}Avg Load:\t${default}${load}"
  64. } | column -s $'\t' -t
  65. echo -e ""
  66. {
  67. echo -e "${blue}Mem:\t${blue}total\tused\tfree\tcached\tavailable${default}"
  68. echo -e "${blue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}\t${physmemavailable}${default}"
  69. echo -e "${blue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}"
  70. } | column -s $'\t' -t
  71. }
  72. fn_info_message_disk(){
  73. #
  74. # Storage
  75. # =====================================
  76. # Filesystem: /dev/disk/by-uuid/320c8edd-a2ce-4a23-8c9d-e00a7af2d6ff
  77. # Total: 15G
  78. # Used: 8.4G
  79. # Available: 5.7G
  80. # LinuxGSM Total: 1G
  81. # Serverfiles: 961M
  82. # Backups: 2G
  83. echo -e ""
  84. echo -e "${lightyellow}Storage${default}"
  85. fn_messages_separator
  86. {
  87. echo -e "${blue}Filesystem:\t${default}${filesystem}"
  88. echo -e "${blue}Total:\t${default}${totalspace}"
  89. echo -e "${blue}Used:\t${default}${usedspace}"
  90. echo -e "${blue}Available:\t${default}${availspace}"
  91. echo -e "${blue}LinuxGSM Total:\t${default}${rootdirdu}"
  92. echo -e "${blue}Serverfiles:\t${default}${serverfilesdu}"
  93. if [ -d "${backupdir}" ]; then
  94. echo -e "${blue}Backups:\t${default}${backupdirdu}"
  95. fi
  96. } | column -s $'\t' -t
  97. }
  98. fn_info_message_gameserver(){
  99. #
  100. # Quake Live Server Details
  101. # =====================================
  102. # Server name: ql-server
  103. # Server IP: 1.2.3.4:27960
  104. # RCON password: CHANGE_ME
  105. # Server password: NOT SET
  106. # Maxplayers: 16
  107. # Status: OFFLINE
  108. echo -e ""
  109. echo -e "${lightgreen}${gamename} Server Details${default}"
  110. fn_info_message_password_strip
  111. fn_messages_separator
  112. {
  113. # Server name
  114. if [ -n "${gdname}" ]; then
  115. echo -e "${blue}Server name:\t${default}${gdname}"
  116. elif [ -n "${servername}" ]; then
  117. echo -e "${blue}Server name:\t${default}${servername}"
  118. fi
  119. # Server description
  120. if [ -n "${serverdescription}" ]; then
  121. echo -e "${blue}Server Description:\t${default}${serverdescription}"
  122. fi
  123. # Branch
  124. if [ -n "${branch}" ]; then
  125. echo -e "${blue}Branch:\t${default}${branch}"
  126. fi
  127. # Server ip
  128. echo -e "${blue}Server IP:\t${default}${ip}:${port}"
  129. # External server ip
  130. if [ -n "${extip}" ]; then
  131. if [ "${ip}" != "${extip}" ]; then
  132. echo -e "${blue}Internet IP:\t${default}${extip}:${port}"
  133. fi
  134. fi
  135. # Server password
  136. if [ -n "${serverpassword}" ]; then
  137. echo -e "${blue}Server password:\t${default}${serverpassword}"
  138. fi
  139. # Query enabled (Starbound)
  140. if [ -n "${queryenabled}" ]; then
  141. echo -e "${blue}Query enabled:\t${default}${queryenabled}"
  142. fi
  143. # RCON enabled (Starbound)
  144. if [ -n "${rconenabled}" ]; then
  145. echo -e "${blue}RCON enabled:\t${default}${rconpassword}"
  146. fi
  147. # RCON password
  148. if [ -n "${rconpassword}" ]; then
  149. echo -e "${blue}RCON password:\t${default}${rconpassword}"
  150. fi
  151. # RCON web (Rust)
  152. if [ -n "${rconweb}" ]; then
  153. echo -e "${blue}RCON web:\t${default}${rconweb}"
  154. fi
  155. # Admin password
  156. if [ -n "${adminpassword}" ]; then
  157. echo -e "${blue}Admin password:\t${default}${adminpassword}"
  158. fi
  159. # Stats password (Quake Live)
  160. if [ -n "${statspassword}" ]; then
  161. echo -e "${blue}Stats password:\t${default}${statspassword}"
  162. fi
  163. # Players
  164. if [ "${querystatus}" != "0" ]; then
  165. if [ -n "${maxplayers}" ]; then
  166. echo -e "${blue}Maxplayers:\t${default}${maxplayers}"
  167. fi
  168. else
  169. if [ -n "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then
  170. echo -e "${blue}Players:\t${default}${gdplayers}/${gdmaxplayers}"
  171. elif [ -n "${gdplayers}" ]&&[ -n "${maxplayers}" ]; then
  172. echo -e "${blue}Players:\t${default}${gdplayers}/${maxplayers}"
  173. elif [ -z "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then
  174. echo -e "${blue}Players:\t${default}0/${gdmaxplayers}"
  175. elif [ -n "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]; then
  176. echo -e "${blue}Players:\t${default}${gdplayers}|∞"
  177. elif [ -z "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]&&[ -n "${maxplayers}" ]; then
  178. echo -e "${blue}Maxplayers:\t${default}${maxplayers}"
  179. fi
  180. fi
  181. # Bots
  182. if [ -n "${gdbots}" ]; then
  183. echo -e "${blue}Bots:\t${default}${gdbots}"
  184. fi
  185. # Current Map
  186. if [ -n "${gdmap}" ]; then
  187. echo -e "${blue}Current Map:\t${default}${gdmap}"
  188. fi
  189. # Default Map
  190. if [ -n "${defaultmap}" ]; then
  191. echo -e "${blue}Default Map:\t${default}${defaultmap}"
  192. fi
  193. # Game mode
  194. if [ -n "${gamemode}" ]; then
  195. echo -e "${blue}Game mode:\t${default}${gamemode}"
  196. fi
  197. # Game world
  198. if [ -n "${gameworld}" ]; then
  199. echo -e "${blue}Game world:\t${default}${gameworld}"
  200. fi
  201. # Tick rate
  202. if [ -n "${tickrate}" ]; then
  203. echo -e "${blue}Tick rate:\t${default}${tickrate}"
  204. fi
  205. # Sharding (Don't Starve Together)
  206. if [ -n "${sharding}" ]; then
  207. echo -e "${blue}Sharding:\t${default}${sharding}"
  208. fi
  209. # Master (Don't Starve Together)
  210. if [ -n "${master}" ]; then
  211. echo -e "${blue}Master:\t${default}${master}"
  212. fi
  213. # Shard (Don't Starve Together)
  214. if [ -n "${shard}" ]; then
  215. echo -e "${blue}Shard:\t${default}${shard}"
  216. fi
  217. # Cluster (Don't Starve Together)
  218. if [ -n "${cluster}" ]; then
  219. echo -e "${blue}Cluster:\t${default}${cluster}"
  220. fi
  221. # Cave (Don't Starve Together)
  222. if [ -n "${cave}" ]; then
  223. echo -e "${blue}Cave:\t${default}${cave}"
  224. fi
  225. # Creativemode (Hurtworld)
  226. if [ -n "${creativemode}" ]; then
  227. echo -e "${blue}Creativemode:\t${default}${creativemode}"
  228. fi
  229. # TeamSpeak dbplugin
  230. if [ -n "${dbplugin}" ]; then
  231. echo -e "${blue}dbplugin:\t${default}${dbplugin}"
  232. fi
  233. # ASE (Multi Theft Auto)
  234. if [ -n "${ase}" ]; then
  235. echo -e "${blue}ASE:\t${default}${ase}"
  236. fi
  237. # Save interval (Rust)
  238. if [ -n "${saveinterval}" ]; then
  239. echo -e "${blue}ASE:\t${default}${saveinterval} s"
  240. fi
  241. # Random map rotation mode (Squad and Post Scriptum)
  242. if [ -n "${randommap}" ]; then
  243. echo -e "${blue}Map rotation:\t${default}${randommap}"
  244. fi
  245. # Listed on Master Server
  246. if [ "${masterserver}" ];then
  247. if [ "${masterserver}" == "true" ];then
  248. echo -e "${blue}Master Server:\t${green}${masterserver}${default}"
  249. else
  250. echo -e "${blue}Master Server:\t${red}${masterserver}${default}"
  251. fi
  252. fi
  253. # Online status
  254. if [ "${status}" == "0" ]; then
  255. echo -e "${blue}Status:\t${red}OFFLINE${default}"
  256. else
  257. echo -e "${blue}Status:\t${green}ONLINE${default}"
  258. fi
  259. } | column -s $'\t' -t
  260. echo -e ""
  261. }
  262. fn_info_message_script(){
  263. #
  264. # qlserver Script Details
  265. # =====================================
  266. # Service name: ql-server
  267. # qlserver version: 150316
  268. # User: lgsm
  269. # Email alert: off
  270. # Update on start: off
  271. # Location: /home/lgsm/qlserver
  272. # Config file: /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg
  273. echo -e "${lightgreen}${selfname} Script Details${default}"
  274. fn_messages_separator
  275. {
  276. # Service name
  277. echo -e "${blue}Service name:\t${default}${servicename}"
  278. # Script version
  279. if [ -n "${version}" ]; then
  280. echo -e "${blue}${selfname} version:\t${default}${version}"
  281. fi
  282. # User
  283. echo -e "${blue}User:\t${default}$(whoami)"
  284. # GLIBC required
  285. if [ -n "${glibcrequired}" ]; then
  286. if [ "${glibcrequired}" == "NOT REQUIRED" ]; then
  287. :
  288. elif [ "${glibcrequired}" == "UNKNOWN" ]; then
  289. echo -e "${blue}GLIBC required:\t${red}${glibcrequired}"
  290. elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then
  291. if [ "${glibcfix}" == "yes" ]; then
  292. echo -e "${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${green}Using GLIBC fix${default})"
  293. else
  294. echo -e "${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${red}GLIBC version too old${default})"
  295. fi
  296. else
  297. echo -e "${blue}GLIBC required:\t${green}${glibcrequired}${default}"
  298. fi
  299. fi
  300. # Discord alert
  301. echo -e "${blue}Discord alert:\t${default}${discordalert}"
  302. # Email alert
  303. echo -e "${blue}Email alert:\t${default}${emailalert}"
  304. # Pushbullet alert
  305. echo -e "${blue}Pushbullet alert:\t${default}${pushbulletalert}"
  306. # IFTTT alert
  307. echo -e "${blue}IFTTT alert:\t${default}${iftttalert}"
  308. # Mailgun alert
  309. echo -e "${blue}Mailgun (email) alert:\t${default}${mailgunalert}"
  310. # Pushover alert
  311. echo -e "${blue}Pushover alert:\t${default}${pushoveralert}"
  312. # Telegram alert
  313. echo -e "${blue}Telegram alert:\t${default}${telegramalert}"
  314. # Update on start
  315. if [ -n "${updateonstart}" ]; then
  316. echo -e "${blue}Update on start:\t${default}${updateonstart}"
  317. fi
  318. # Script location
  319. echo -e "${blue}Location:\t${default}${rootdir}"
  320. # Config file location
  321. if [ -n "${servercfgfullpath}" ]; then
  322. if [ -f "${servercfgfullpath}" ]; then
  323. echo -e "${blue}Config file:\t${default}${servercfgfullpath}"
  324. elif [ -d "${servercfgfullpath}" ]; then
  325. echo -e "${blue}Config dir:\t${default}${servercfgfullpath}"
  326. else
  327. echo -e "${blue}Config file:\t${default}${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})"
  328. fi
  329. fi
  330. # Network config file location (ARMA 3)
  331. if [ -n "${networkcfgfullpath}" ]; then
  332. echo -e "${blue}Network config file:\t${default}${networkcfgfullpath}"
  333. fi
  334. } | column -s $'\t' -t
  335. }
  336. fn_info_message_backup(){
  337. #
  338. # Backups
  339. # =====================================
  340. # No. of backups: 1
  341. # Latest backup:
  342. # date: Fri May 6 18:34:19 UTC 2016
  343. # file: /home/lgsm/qlserver/backups/ql-server-2016-05-06-183239.tar.gz
  344. # size: 945M
  345. echo -e ""
  346. echo -e "${lightgreen}Backups${default}"
  347. fn_messages_separator
  348. if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
  349. echo -e "No Backups created"
  350. else
  351. {
  352. echo -e "${blue}No. of backups:\t${default}${backupcount}"
  353. echo -e "${blue}Latest backup:${default}"
  354. if [ "${lastbackupdaysago}" == "0" ]; then
  355. echo -e "${blue} date:\t${default}${lastbackupdate} (less than 1 day ago)"
  356. elif [ "${lastbackupdaysago}" == "1" ]; then
  357. echo -e "${blue} date:\t${default}${lastbackupdate} (1 day ago)"
  358. else
  359. echo -e "${blue} date:\t${default}${lastbackupdate} (${lastbackupdaysago} days ago)"
  360. fi
  361. echo -e "${blue} file:\t${default}${lastbackup}"
  362. echo -e "${blue} size:\t${default}${lastbackupsize}"
  363. } | column -s $'\t' -t
  364. fi
  365. }
  366. fn_info_message_commandlineparms(){
  367. #
  368. # Command-line Parameters
  369. # =====================================
  370. # ./run_server_x86.sh +set net_strict 1
  371. echo -e ""
  372. echo -e "${lightgreen}Command-line Parameters${default}"
  373. fn_info_message_password_strip
  374. fn_messages_separator
  375. echo -e "${executable} ${parms}"
  376. }
  377. fn_info_message_ports(){
  378. # Ports
  379. # =====================================
  380. # Change ports by editing the parameters in:
  381. # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg
  382. echo -e ""
  383. echo -e "${lightgreen}Ports${default}"
  384. fn_messages_separator
  385. echo -e "Change ports by editing the parameters in:"
  386. parmslocation="${red}UNKNOWN${default}"
  387. # engines/games that require editing in the config file
  388. local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" )
  389. for port_edit in "${ports_edit_array[@]}"
  390. do
  391. if [ "${shortname}" == "ut3" ]; then
  392. parmslocation="${servercfgdir}/UTWeb.ini"
  393. elif [ "${shortname}" == "kf2" ]; then
  394. parmslocation="${servercfgdir}/LinuxServer-KFEngine.ini\n${servercfgdir}/KFWeb.ini"
  395. elif [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
  396. parmslocation="${servercfgfullpath}"
  397. fi
  398. done
  399. # engines/games that require editing the parms
  400. local ports_edit_array=( "goldsource" "Factorio" "Hurtworld" "iw3.0" "Rust" "spark" "source" "starbound" "unreal4" "realvirtuality")
  401. for port_edit in "${ports_edit_array[@]}"
  402. do
  403. if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
  404. parmslocation="${configdirserver}"
  405. fi
  406. done
  407. echo -e "${parmslocation}"
  408. echo -e ""
  409. echo -e "Useful port diagnostic command:"
  410. }
  411. fn_info_message_statusbottom(){
  412. echo -e ""
  413. if [ "${status}" == "0" ]; then
  414. echo -e "${blue}Status:\t${red}OFFLINE${default}"
  415. else
  416. echo -e "${blue}Status:\t${green}ONLINE${default}"
  417. fi
  418. echo -e ""
  419. }
  420. fn_info_logs(){
  421. echo -e ""
  422. echo -e "${servicename} Logs"
  423. echo -e "================================="
  424. if [ -n "${lgsmlog}" ]; then
  425. echo -e "\nScript log\n==================="
  426. if [ ! "$(ls -A "${lgsmlogdir}")" ]; then
  427. echo "${lgsmlogdir} (NO LOG FILES)"
  428. elif [ ! -s "${lgsmlog}" ]; then
  429. echo "${lgsmlog} (LOG FILE IS EMPTY)"
  430. else
  431. echo "${lgsmlog}"
  432. tail -25 "${lgsmlog}"
  433. fi
  434. echo ""
  435. fi
  436. if [ -n "${consolelog}" ]; then
  437. echo -e "\nConsole log\n===================="
  438. if [ ! "$(ls -A "${consolelogdir}")" ]; then
  439. echo "${consolelogdir} (NO LOG FILES)"
  440. elif [ ! -s "${consolelog}" ]; then
  441. echo "${consolelog} (LOG FILE IS EMPTY)"
  442. else
  443. echo "${consolelog}"
  444. tail -25 "${consolelog}" | awk '{ sub("\r$", ""); print }'
  445. fi
  446. echo ""
  447. fi
  448. if [ -n "${gamelogdir}" ]; then
  449. echo -e "\nServer log\n==================="
  450. if [ ! "$(ls -A "${gamelogdir}")" ]; then
  451. echo "${gamelogdir} (NO LOG FILES)"
  452. else
  453. echo "${gamelogdir}"
  454. # dos2unix sed 's/\r//'
  455. tail "${gamelogdir}"/* 2>/dev/null | grep -v "==>" | sed '/^$/d' | sed 's/\r//' | tail -25
  456. fi
  457. echo ""
  458. fi
  459. }
  460. # Engine/Game Specific details
  461. fn_info_message_ark(){
  462. echo -e "netstat -atunp | grep ShooterGame"
  463. echo -e ""
  464. {
  465. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  466. echo -e "> Game\tINBOUND\t${port}\tudp"
  467. # Don't do arithmetics if ever the port wasn't a numeric value
  468. if [ "${port}" -eq "${port}" ]; then
  469. echo -e "> RAW\tINBOUND\t$((port+1))\tudp"
  470. fi
  471. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  472. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  473. } | column -s $'\t' -t
  474. }
  475. fn_info_message_ballisticoverkill(){
  476. echo -e "netstat -atunp | grep BODS.x86"
  477. echo -e ""
  478. {
  479. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  480. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  481. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  482. } | column -s $'\t' -t
  483. }
  484. fn_info_message_battalion1944(){
  485. echo -e "netstat -atunp | grep BattalionServ"
  486. echo -e ""
  487. {
  488. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  489. echo -e "> Game\tINBOUND\t${port}\tudp"
  490. # Don't do arithmetics if ever the port wasn't a numeric value
  491. # unconfirmed - http://wiki.battaliongame.com/Community_Servers#Firewalls_.2F_Port_Forwarding
  492. if [ "${port}" -eq "${port}" ]; then
  493. echo -e "> Steam\tINBOUND\t$((port+1))\tudp"
  494. echo -e "> Unused\tINBOUND\t$((port+2))\ttcp"
  495. fi
  496. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  497. } | column -s $'\t' -t
  498. }
  499. fn_info_message_cod(){
  500. echo -e "netstat -atunp | grep cod_lnxded"
  501. echo -e ""
  502. {
  503. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  504. echo -e "> Game\tINBOUND\t${port}\tudp"
  505. } | column -s $'\t' -t
  506. }
  507. fn_info_message_coduo(){
  508. echo -e "netstat -atunp | grep coduo_lnxded"
  509. echo -e ""
  510. {
  511. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  512. echo -e "> Game\tINBOUND\t${port}\tudp"
  513. } | column -s $'\t' -t
  514. }
  515. fn_info_message_cod2(){
  516. echo -e "netstat -atunp | grep cod2_lnxded"
  517. echo -e ""
  518. {
  519. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  520. echo -e "> Game\tINBOUND\t${port}\tudp"
  521. } | column -s $'\t' -t
  522. }
  523. fn_info_message_cod4(){
  524. echo -e "netstat -atunp"
  525. echo -e ""
  526. {
  527. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  528. echo -e "> Game\tINBOUND\t${port}\tudp"
  529. } | column -s $'\t' -t
  530. }
  531. fn_info_message_codwaw(){
  532. echo -e "netstat -atunp | grep codwaw_lnxded"
  533. echo -e ""
  534. {
  535. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  536. echo -e "> Game\tINBOUND\t${port}\tudp"
  537. } | column -s $'\t' -t
  538. }
  539. fn_info_message_dontstarve(){
  540. echo -e "netstat -atunp | grep dontstarve"
  541. echo -e ""
  542. {
  543. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  544. echo -e "> Game: Server\tINBOUND\t${port}\tudp"
  545. echo -e "> Game: Master\tINBOUND\t${masterport}\tudp"
  546. echo -e "> Steam: Auth\tINBOUND\t${steamauthenticationport}\tudp"
  547. echo -e "> Steam: Master\tINBOUND\t${steammasterserverport}\tudp"
  548. } | column -s $'\t' -t
  549. }
  550. fn_info_message_eco(){
  551. echo -e "netstat -atunp | grep mono"
  552. echo -e ""
  553. {
  554. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  555. echo -e "> Game\tINBOUND\t${port}\tudp"
  556. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  557. } | column -s $'\t' -t
  558. }
  559. fn_info_message_factorio(){
  560. echo -e "netstat -atunp | grep factorio"
  561. echo -e ""
  562. {
  563. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  564. echo -e "> Game\tINBOUND\t${port}\ttcp"
  565. } | column -s $'\t' -t
  566. }
  567. fn_info_message_goldsource(){
  568. echo -e "netstat -atunp | grep hlds_linux"
  569. echo -e ""
  570. {
  571. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  572. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  573. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  574. } | column -s $'\t' -t
  575. }
  576. fn_info_message_hurtworld(){
  577. echo -e "netstat -atunp | grep Hurtworld"
  578. echo -e ""
  579. {
  580. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  581. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  582. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  583. } | column -s $'\t' -t
  584. }
  585. fn_info_message_justcause2(){
  586. echo -e "netstat -atunp | grep Jcmp-Server"
  587. echo -e ""
  588. {
  589. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  590. echo -e "> Game\tINBOUND\t${port}\tudp"
  591. } | column -s $'\t' -t
  592. }
  593. fn_info_message_justcause3(){
  594. echo -e "netstat -atunp | grep Server"
  595. echo -e ""
  596. {
  597. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  598. echo -e "> Game\tINBOUND\t${port}\tudp"
  599. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  600. echo -e "> Steam\tINBOUND\t${steamport}\tudp"
  601. } | column -s $'\t' -t
  602. }
  603. fn_info_message_minecraft(){
  604. echo -e "netstat -atunp | grep java"
  605. echo -e ""
  606. {
  607. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  608. echo -e "> Game\tINBOUND\t${port}\ttcp"
  609. echo -e "> Game\tINBOUND\t${queryport}\tudp"
  610. echo -e "> Game\tINBOUND\t${rconport}\ttcp"
  611. } | column -s $'\t' -t
  612. }
  613. fn_info_message_mumble(){
  614. echo -e "netstat -atunp | grep murmur"
  615. echo -e ""
  616. {
  617. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  618. echo -e "> Voice\tINBOUND\t${port}\tudp"
  619. echo -e "> ServerQuery\tINBOUND\t${port}\ttcp"
  620. } | column -s $'\t' -t
  621. }
  622. fn_info_Message_pstbs(){
  623. echo -e "netstat -atunp | grep PostScriptum"
  624. echo -e ""
  625. {
  626. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  627. echo -e "> Game\tINBOUND\t${port}\tudp"
  628. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  629. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  630. } | column -s $'\t' -t
  631. }
  632. fn_info_message_projectcars(){
  633. echo -e "netstat -atunp | grep DedicatedS"
  634. echo -e ""
  635. {
  636. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  637. echo -e "> Game\tINBOUND\t${port}\tudp"
  638. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  639. echo -e "> Steam\tINBOUND\t${steamport}\tudp"
  640. } | column -s $'\t' -t
  641. }
  642. fn_info_message_projectzomboid(){
  643. echo -e "netstat -atunp | grep java"
  644. echo -e ""
  645. {
  646. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  647. echo -e "> Game\tINBOUND\t${port}\tudp"
  648. } | column -s $'\t' -t
  649. }
  650. fn_info_message_quake(){
  651. echo -e "netstat -atunp | grep mvdsv"
  652. echo -e ""
  653. {
  654. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  655. echo -e "> Game\tINBOUND\t${port}\tudp"
  656. } | column -s $'\t' -t
  657. }
  658. fn_info_message_quake2(){
  659. echo -e "netstat -atunp | grep quake2"
  660. echo -e ""
  661. {
  662. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  663. echo -e "> Game\tINBOUND\t${port}\tudp"
  664. } | column -s $'\t' -t
  665. }
  666. fn_info_message_quake3(){
  667. echo -e "netstat -atunp | grep q3ded"
  668. echo -e ""
  669. {
  670. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  671. echo -e "> Game\tINBOUND\t${port}\tudp"
  672. } | column -s $'\t' -t
  673. }
  674. fn_info_message_quakelive(){
  675. echo -e "netstat -atunp | grep qzeroded"
  676. echo -e ""
  677. if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then
  678. echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}."
  679. echo -e ""
  680. fi
  681. {
  682. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  683. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  684. echo -e "> Rcon\tINBOUND\t${rconport}\tudp"
  685. echo -e "> Stats\tINBOUND\t${statsport}\tudp"
  686. } | column -s $'\t' -t
  687. }
  688. fn_info_message_realvirtuality(){
  689. echo -e "netstat -atunp | grep arma3server"
  690. echo -e ""
  691. # Default port
  692. if [ -z "${port}" ]; then
  693. port="2302"
  694. fi
  695. {
  696. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  697. echo -e "> Game\tINBOUND\t${port}\tudp"
  698. # Don't do arithmetics if ever the port wasn't a numeric value
  699. if [ "${port}" -eq "${port}" ]; then
  700. echo -e "> Steam: Query\tINBOUND\t$((port+1))\tudp"
  701. echo -e "> Steam: Master traffic\tINBOUND\t$((port+2))\tudp"
  702. echo -e "> Undocumented Port\tINBOUND\t$((port+3))\tudp"
  703. fi
  704. } | column -s $'\t' -t
  705. }
  706. fn_info_message_refractor(){
  707. echo -e "netstat -atunp | grep bf1942_lnxd"
  708. echo -e ""
  709. {
  710. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  711. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  712. echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp"
  713. } | column -s $'\t' -t
  714. }
  715. fn_info_message_risingworld(){
  716. echo -e "netstat -atunp | grep java"
  717. echo -e ""
  718. {
  719. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  720. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  721. echo -e "> http query\tINBOUND\t${httpqueryport}\ttcp"
  722. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  723. } | column -s $'\t' -t
  724. }
  725. fn_info_message_rust(){
  726. echo -e "netstat -atunp | grep Rust"
  727. echo -e ""
  728. {
  729. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  730. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  731. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  732. } | column -s $'\t' -t
  733. }
  734. fn_info_message_samp(){
  735. echo -e "netstat -atunp | grep samp03svr"
  736. echo -e ""
  737. {
  738. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  739. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  740. } | column -s $'\t' -t
  741. }
  742. fn_info_message_seriousengine35(){
  743. echo -e "netstat -atunp | grep Sam3_Dedicate"
  744. echo -e ""
  745. {
  746. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  747. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp"
  748. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  749. } | column -s $'\t' -t
  750. }
  751. fn_info_message_sdtd(){
  752. fn_info_message_password_strip
  753. echo -e "netstat -atunp | grep 7DaysToDie"
  754. echo -e ""
  755. {
  756. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  757. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  758. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  759. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  760. echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
  761. } | column -s $'\t' -t
  762. echo -e ""
  763. echo -e "${lightgreen}${servername} WebAdmin${default}"
  764. fn_messages_separator
  765. {
  766. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  767. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  768. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  769. } | column -s $'\t' -t
  770. echo -e ""
  771. echo -e "${lightgreen}${servername} Telnet${default}"
  772. fn_messages_separator
  773. {
  774. echo -e "${blue}Telnet enabled:\t${default}${telnetenabled}"
  775. echo -e "${blue}Telnet address:\t${default}${ip} ${telnetport}"
  776. echo -e "${blue}Telnet password:\t${default}${telnetpass}"
  777. } | column -s $'\t' -t
  778. }
  779. fn_info_message_source(){
  780. echo -e "netstat -atunp | grep srcds_linux"
  781. echo -e ""
  782. {
  783. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  784. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  785. echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp"
  786. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  787. } | column -s $'\t' -t
  788. }
  789. fn_info_message_spark(){
  790. fn_info_message_password_strip
  791. echo -e "netstat -atunp | grep server_linux"
  792. echo -e ""
  793. {
  794. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  795. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  796. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  797. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  798. } | column -s $'\t' -t
  799. echo -e ""
  800. echo -e "${lightgreen}${servername} WebAdmin${default}"
  801. fn_messages_separator
  802. {
  803. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}/index.html"
  804. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  805. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  806. } | column -s $'\t' -t
  807. }
  808. fn_info_message_squad(){
  809. echo -e "netstat -atunp | grep SquadServer"
  810. echo -e ""
  811. {
  812. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  813. echo -e "> Game\tINBOUND\t${port}\tudp"
  814. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  815. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  816. } | column -s $'\t' -t
  817. }
  818. fn_info_message_starbound(){
  819. echo -e "netstat -atunp | grep starbound"
  820. echo -e ""
  821. {
  822. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  823. echo -e "> Game\tINBOUND\t${port}\ttcp"
  824. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  825. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  826. } | column -s $'\t' -t
  827. }
  828. fn_info_message_stationeers(){
  829. echo -e "netstat -atunp | grep rocketstation"
  830. echo -e ""
  831. {
  832. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  833. echo -e "> Game\tINBOUND\t${port}\ttcp"
  834. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  835. } | column -s $'\t' -t
  836. }
  837. fn_info_message_teamspeak3(){
  838. echo -e "netstat -atunp | grep ts3server"
  839. echo -e ""
  840. {
  841. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  842. echo -e "> Voice\tINBOUND\t${port}\tudp"
  843. echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp"
  844. echo -e "> File transfer\tINBOUND\t${fileport}\ttcp"
  845. } | column -s $'\t' -t
  846. }
  847. fn_info_message_teeworlds(){
  848. echo -e "netstat -atunp | grep teeworlds_srv"
  849. echo -e ""
  850. {
  851. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  852. echo -e "> Game\tINBOUND\t${port}\ttcp"
  853. } | column -s $'\t' -t
  854. }
  855. fn_info_message_terraria(){
  856. echo -e "netstat -atunp | grep TerrariaServer"
  857. echo -e ""
  858. {
  859. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  860. echo -e "> Game\tINBOUND\t${port}\ttcp"
  861. } | column -s $'\t' -t
  862. }
  863. fn_info_message_towerunite(){
  864. echo -e "netstat -atunp | grep TowerServer"
  865. echo -e ""
  866. {
  867. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  868. echo -e "> Game\tINBOUND\t${port}\ttcp"
  869. # Don't do arithmetics if ever the port wasn't a numeric value
  870. if [ "${port}" -eq "${port}" ]; then
  871. echo -e "> Steam\tINBOUND\t$((port+1))\tudp"
  872. fi
  873. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  874. } | column -s $'\t' -t
  875. }
  876. fn_info_message_unreal(){
  877. fn_info_message_password_strip
  878. echo -e "netstat -atunp | grep ucc-bin"
  879. echo -e ""
  880. {
  881. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  882. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  883. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  884. if [ "${engine}" == "unreal" ]; then
  885. echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp"
  886. fi
  887. if [ "${engine}" != "unreal" ] && [ "${appid}" != "223250" ]; then
  888. echo -e "> GameSpy query\tINBOUND\t${gsqueryport}\tudp\tOldQueryPortNumber=${gsqueryport}"
  889. fi
  890. if [ "${appid}" == "215360" ]; then
  891. echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp"
  892. else
  893. echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp"
  894. fi
  895. if [ "${appid}" ]; then
  896. if [ "${appid}" == "223250" ]; then
  897. echo -e "< Steam\tINBOUND\t20610\tudp"
  898. else
  899. echo -e "< Steam\tINBOUND\t20660\tudp"
  900. fi
  901. fi
  902. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  903. } | column -s $'\t' -t
  904. echo -e ""
  905. echo -e "${lightgreen}${servername} WebAdmin${default}"
  906. fn_messages_separator
  907. {
  908. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  909. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  910. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  911. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  912. } | column -s $'\t' -t
  913. }
  914. fn_info_message_unreal3(){
  915. echo -e "netstat -atunp | grep ut3-bin"
  916. echo -e ""
  917. {
  918. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  919. echo -e "> Game\tINBOUND\t${port}\tudp"
  920. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  921. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  922. } | column -s $'\t' -t
  923. echo -e ""
  924. echo -e "${lightgreen}${servername} WebAdmin${default}"
  925. fn_messages_separator
  926. {
  927. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  928. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  929. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  930. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  931. } | column -s $'\t' -t
  932. }
  933. fn_info_message_kf2(){
  934. echo -e "netstat -atunp | grep KFGame"
  935. echo -e ""
  936. {
  937. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  938. echo -e "> Game\tINBOUND\t${port}\ttcp\tPort=${port}"
  939. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  940. echo -e "> Steam\tINBOUND\t20560\tudp"
  941. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  942. } | column -s $'\t' -t
  943. echo -e ""
  944. echo -e "${lightgreen}${servername} WebAdmin${default}"
  945. fn_messages_separator
  946. {
  947. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  948. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  949. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  950. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  951. } | column -s $'\t' -t
  952. }
  953. fn_info_message_wolfensteinenemyterritory(){
  954. echo -e "netstat -atunp | grep etded"
  955. echo -e ""
  956. {
  957. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  958. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  959. } | column -s $'\t' -t
  960. }
  961. fn_info_message_etlegacy(){
  962. echo -e "netstat -atunp | grep etlded"
  963. echo -e ""
  964. {
  965. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  966. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  967. } | column -s $'\t' -t
  968. }
  969. fn_info_message_mta(){
  970. echo -e "netstat -atunp | grep mta-server64"
  971. echo -e ""
  972. {
  973. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  974. echo -e "> Game\tOUTBOUND\t${port}\tudp"
  975. echo -e "> HTTP Server\tINBOUND\t${httpport}\ttcp"
  976. if [ "${ase}" == "Enabled" ]; then
  977. echo -e "> ASE Game_Monitor\tOUTBOUND\t$((${port} + 123))\tudp"
  978. fi
  979. } | column -s $'\t' -t
  980. }
  981. fn_info_message_select_engine(){
  982. # Display details depending on game or engine.
  983. if [ "${gamename}" == "7 Days To Die" ]; then
  984. fn_info_message_sdtd
  985. elif [ "${gamename}" == "ARK: Survival Evolved" ]; then
  986. fn_info_message_ark
  987. elif [ "${gamename}" == "Ballistic Overkill" ]; then
  988. fn_info_message_ballisticoverkill
  989. elif [ "${gamename}" == "Battalion 1944" ]; then
  990. fn_info_message_battalion1944
  991. elif [ "${gamename}" == "Call of Duty" ]; then
  992. fn_info_message_cod
  993. elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then
  994. fn_info_message_coduo
  995. elif [ "${gamename}" == "Call of Duty 2" ]; then
  996. fn_info_message_cod2
  997. elif [ "${gamename}" == "Call of Duty 4" ]; then
  998. fn_info_message_cod4
  999. elif [ "${gamename}" == "Call of Duty: World at War" ]; then
  1000. fn_info_message_codwaw
  1001. elif [ "${gamename}" == "Eco" ]; then
  1002. fn_info_message_eco
  1003. elif [ "${gamename}" == "ET: Legacy" ]; then
  1004. fn_info_message_etlegacy
  1005. elif [ "${gamename}" == "Factorio" ]; then
  1006. fn_info_message_factorio
  1007. elif [ "${gamename}" == "Hurtworld" ]; then
  1008. fn_info_message_hurtworld
  1009. elif [ "${gamename}" == "Just Cause 2" ]; then
  1010. fn_info_message_justcause2
  1011. elif [ "${gamename}" == "Just Cause 3" ]; then
  1012. fn_info_message_justcause3
  1013. elif [ "${shortname}" == "kf2" ]; then
  1014. fn_info_message_kf2
  1015. elif [ "${shortname}" == "pstbs" ]; then
  1016. fn_info_Message_pstbs
  1017. elif [ "${gamename}" == "Project Cars" ]; then
  1018. fn_info_message_projectcars
  1019. elif [ "${gamename}" == "QuakeWorld" ]; then
  1020. fn_info_message_quake
  1021. elif [ "${gamename}" == "Quake 2" ]; then
  1022. fn_info_message_quake2
  1023. elif [ "${gamename}" == "Quake 3: Arena" ]; then
  1024. fn_info_message_quake3
  1025. elif [ "${gamename}" == "Quake Live" ]; then
  1026. fn_info_message_quakelive
  1027. elif [ "${gamename}" == "San Andreas Multiplayer" ]; then
  1028. fn_info_message_samp
  1029. elif [ "${gamename}" == "Squad" ]; then
  1030. fn_info_message_squad
  1031. elif [ "${gamename}" == "Stationeers" ]; then
  1032. fn_info_message_stationeers
  1033. elif [ "${gamename}" == "TeamSpeak 3" ]; then
  1034. fn_info_message_teamspeak3
  1035. elif [ "${gamename}" == "Tower Unite" ]; then
  1036. fn_info_message_towerunite
  1037. elif [ "${gamename}" == "Multi Theft Auto" ]; then
  1038. fn_info_message_mta
  1039. elif [ "${gamename}" == "Mumble" ]; then
  1040. fn_info_message_mumble
  1041. elif [ "${gamename}" == "Rust" ]; then
  1042. fn_info_message_rust
  1043. elif [ "${shortname}" == "rw" ]; then
  1044. fn_info_message_risingworld
  1045. elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
  1046. fn_info_message_wolfensteinenemyterritory
  1047. elif [ "${engine}" == "refractor" ]; then
  1048. fn_info_message_refractor
  1049. elif [ "${engine}" == "dontstarve" ]; then
  1050. fn_info_message_dontstarve
  1051. elif [ "${engine}" == "goldsource" ]; then
  1052. fn_info_message_goldsource
  1053. elif [ "${engine}" == "lwjgl2" ]; then
  1054. fn_info_message_minecraft
  1055. elif [ "${engine}" == "projectzomboid" ]; then
  1056. fn_info_message_projectzomboid
  1057. elif [ "${engine}" == "realvirtuality" ]; then
  1058. fn_info_message_realvirtuality
  1059. elif [ "${engine}" == "seriousengine35" ]; then
  1060. fn_info_message_seriousengine35
  1061. elif [ "${engine}" == "source" ]; then
  1062. fn_info_message_source
  1063. elif [ "${engine}" == "spark" ]; then
  1064. fn_info_message_spark
  1065. elif [ "${engine}" == "starbound" ]; then
  1066. fn_info_message_starbound
  1067. elif [ "${engine}" == "teeworlds" ]; then
  1068. fn_info_message_teeworlds
  1069. elif [ "${engine}" == "terraria" ]; then
  1070. fn_info_message_terraria
  1071. elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
  1072. fn_info_message_unreal
  1073. elif [ "${engine}" == "unreal3" ]; then
  1074. fn_info_message_unreal3
  1075. else
  1076. fn_print_error_nl "Unable to detect server engine."
  1077. fi
  1078. }
  1079. # Separator is different for details
  1080. fn_messages_separator(){
  1081. if [ "${function_selfname}" == "command_details.sh" ]; then
  1082. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  1083. else
  1084. echo -e "================================="
  1085. fi
  1086. }
  1087. # Removes the passwords form all but details
  1088. fn_info_message_password_strip(){
  1089. if [ "${function_selfname}" != "command_details.sh" ]; then
  1090. if [ -n "${serverpassword}" ]; then
  1091. serverpassword="********"
  1092. fi
  1093. if [ -n "${rconpassword}" ]; then
  1094. rconpassword="********"
  1095. fi
  1096. if [ -n "${adminpassword}" ]; then
  1097. adminpassword="********"
  1098. fi
  1099. if [ -n "${statspassword}" ]; then
  1100. statspassword="********"
  1101. fi
  1102. if [ -n "${webadminpass}" ]; then
  1103. webadminpass="********"
  1104. fi
  1105. if [ -n "${telnetpass}" ]; then
  1106. telnetpass="********"
  1107. fi
  1108. if [ -n "${wsapikey}" ]; then
  1109. wsapikey="********"
  1110. fi
  1111. if [ -n "${gslt}" ]; then
  1112. gslt="********"
  1113. fi
  1114. fi
  1115. }