info_messages.sh 36 KB

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