info_messages.sh 50 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714
  1. #!/bin/bash
  2. # LinuxGSM info_messages.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: http://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Defines server info messages for details and alerts.
  7. functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. # Separator is different for details.
  9. fn_messages_separator(){
  10. if [ "${commandname}" == "DETAILS" ]; then
  11. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  12. else
  13. echo -e "================================="
  14. fi
  15. }
  16. # Removes the passwords form all but details.
  17. fn_info_message_password_strip(){
  18. if [ "${commandname}" != "DETAILS" ]; then
  19. if [ "${serverpassword}" ]; then
  20. serverpassword="********"
  21. fi
  22. if [ "${rconpassword}" ]; then
  23. rconpassword="********"
  24. fi
  25. if [ "${adminpassword}" ]; then
  26. adminpassword="********"
  27. fi
  28. if [ "${statspassword}" ]; then
  29. statspassword="********"
  30. fi
  31. if [ "${webadminpass}" ]; then
  32. webadminpass="********"
  33. fi
  34. if [ "${telnetpass}" ]; then
  35. telnetpass="********"
  36. fi
  37. if [ "${wsapikey}" ]; then
  38. wsapikey="********"
  39. fi
  40. if [ "${gslt}" ]; then
  41. gslt="********"
  42. fi
  43. fi
  44. }
  45. # Alert Summary
  46. # used with alertlog
  47. fn_info_message_head(){
  48. echo -e ""
  49. echo -e "${lightyellow}Alert Summary${default}"
  50. fn_messages_separator
  51. echo -e "Message"
  52. echo -e "${alertbody}"
  53. echo -e ""
  54. echo -e "Game"
  55. echo -e "${gamename}"
  56. echo -e ""
  57. echo -e "Server name"
  58. echo -e "${servername}"
  59. echo -e ""
  60. echo -e "Hostname"
  61. echo -e "${HOSTNAME}"
  62. echo -e ""
  63. echo -e "Server IP"
  64. echo -e "${ip}:${port}"
  65. }
  66. fn_info_message_distro(){
  67. #
  68. # Distro Details
  69. # =================================
  70. # Date: Sun 21 Feb 2021 09:22:53 AM UTC
  71. # Distro: Ubuntu 20.04.2 LTS
  72. # Arch: x86_64
  73. # Kernel: 5.4.0-65-generic
  74. # Hostname: server
  75. # Uptime: 16d, 5h, 18m
  76. # tmux: tmux 3.0a
  77. # glibc: 2.31
  78. echo -e ""
  79. echo -e "${lightyellow}Distro Details${default}"
  80. fn_messages_separator
  81. {
  82. echo -e "${lightblue}Date:\t${default}${date}"
  83. echo -e "${lightblue}Distro:\t${default}${distroname}"
  84. echo -e "${lightblue}Arch:\t${default}${arch}"
  85. echo -e "${lightblue}Kernel:\t${default}${kernel}"
  86. echo -e "${lightblue}Hostname:\t${default}${HOSTNAME}"
  87. echo -e "${lightblue}Uptime:\t${default}${days}d, ${hours}h, ${minutes}m"
  88. echo -e "${lightblue}tmux:\t${default}${tmuxv}"
  89. echo -e "${lightblue}glibc:\t${default}${glibcversion}"
  90. if [ -n "${javaram}" ]; then
  91. echo -e "${lightblue}Java:\t${default}${javaversion}"
  92. fi
  93. } | column -s $'\t' -t
  94. }
  95. fn_info_message_server_resource(){
  96. #
  97. # Server Resource
  98. # =================================
  99. # CPU
  100. # Model: AMD EPYC 7601 32-Core Processor
  101. # Cores: 2
  102. # Frequency: 2199.994MHz
  103. # Avg Load: 0.01, 0.05, 0.18
  104. #
  105. # Memory
  106. # Mem: total used free cached available
  107. # Physical: 3.9GB 350MB 3.3GB 3.2GB 3.3GB
  108. # Swap: 512MB 55MB 458MB
  109. #
  110. # Storage
  111. # Filesystem: /dev/sda
  112. # Total: 79G
  113. # Used: 73G
  114. # Available: 1.4G
  115. #
  116. # Network
  117. # IP: 0.0.0.0
  118. # Internet IP: 176.58.124.96
  119. echo -e ""
  120. echo -e "${lightyellow}Server Resource${default}"
  121. fn_messages_separator
  122. {
  123. echo -e "${lightyellow}CPU\t${default}"
  124. echo -e "${lightblue}Model:\t${default}${cpumodel}"
  125. echo -e "${lightblue}Cores:\t${default}${cpucores}"
  126. echo -e "${lightblue}Frequency:\t${default}${cpufreqency}MHz"
  127. echo -e "${lightblue}Avg Load:\t${default}${load}"
  128. } | column -s $'\t' -t
  129. echo -e ""
  130. {
  131. echo -e "${lightyellow}Memory\t${default}"
  132. echo -e "${lightblue}Mem:\t${lightblue}total\tused\tfree\tcached\tavailable${default}"
  133. echo -e "${lightblue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}\t${physmemavailable}${default}"
  134. echo -e "${lightblue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}"
  135. } | column -s $'\t' -t
  136. echo -e ""
  137. {
  138. echo -e "${lightyellow}Storage${default}"
  139. echo -e "${lightblue}Filesystem:\t${default}${filesystem}"
  140. echo -e "${lightblue}Total:\t\t${default}${totalspace}"
  141. echo -e "${lightblue}Used:\t\t${default}${usedspace}"
  142. echo -e "${lightblue}Available:\t${default}${availspace}"
  143. } | column -s $'\t' -t
  144. echo -e ""
  145. {
  146. echo -e "${lightyellow}Network${default}"
  147. if [ -n "${netint}" ]; then
  148. echo -e "${lightblue}Interface:\t${default}${netint}"
  149. fi
  150. if [ -n "${netlink}" ]; then
  151. echo -e "${lightblue}Link Speed:\t${default}${netlink}"
  152. fi
  153. echo -e "${lightblue}IP:\t${default}${ip}"
  154. if [ "${ip}" != "${extip}" ]; then
  155. echo -e "${lightblue}Internet IP:\t${default}${extip}"
  156. fi
  157. } | column -s $'\t' -t
  158. }
  159. fn_info_message_gameserver_resource(){
  160. #
  161. # Game Server Resource Usage
  162. # =================================
  163. # CPU Used: 1.1%
  164. # Mem Used: 4.8% 189MB
  165. #
  166. # Storage
  167. # Total: 241M
  168. # Serverfiles: 240M
  169. # Backups: 24K
  170. echo -e ""
  171. echo -e "${lightyellow}Game Server Resource Usage${default}"
  172. fn_messages_separator
  173. {
  174. if [ "${status}" != "0" ]&&[ -v status ]; then
  175. if [ -n "${cpuused}" ]; then
  176. echo -e "${lightblue}CPU Used:\t${default}${cpuused}%${default}"
  177. else
  178. echo -e "${lightblue}CPU Used:\t${red}unknown${default}"
  179. fi
  180. if [ -n "${memused}" ]; then
  181. echo -e "${lightblue}Mem Used:\t${default}${pmemused}%\t${memused}MB${default}"
  182. else
  183. echo -e "${lightblue}Mem Used:\t${default}${pmemused}\t${red}unknown${default}"
  184. fi
  185. else
  186. echo -e "${lightblue}CPU Used:\t${default}0%${default}"
  187. echo -e "${lightblue}Mem Used:\t${default}0%\t0MB${default}"
  188. fi
  189. } | column -s $'\t' -t
  190. echo -e ""
  191. {
  192. echo -e "${lightyellow}Storage${default}"
  193. echo -e "${lightblue}Total:\t${default}${rootdirdu}"
  194. echo -e "${lightblue}Serverfiles:\t${default}${serverfilesdu}"
  195. if [ -d "${backupdir}" ]; then
  196. echo -e "${lightblue}Backups:\t${default}${backupdirdu}"
  197. fi
  198. } | column -s $'\t' -t
  199. }
  200. fn_info_message_gameserver(){
  201. #
  202. # Counter-Strike: Global Offensive Server Details
  203. # =================================
  204. # Server name: LinuxGSM
  205. # Server IP: 0.0.0.0:27015
  206. # Internet IP: 176.48.124.96:34197
  207. # Server password: NOT SET
  208. # RCON password: adminF54CC0VR
  209. # Players: 0/16
  210. # Current map: de_mirage
  211. # Default map: de_mirage
  212. # Game type: 0
  213. # Game mode: 0
  214. # Tick rate: 64
  215. # Master Server: listed
  216. # Status: STARTED
  217. echo -e ""
  218. echo -e "${lightgreen}${gamename} Server Details${default}"
  219. fn_info_message_password_strip
  220. fn_messages_separator
  221. {
  222. # Server name
  223. if [ -n "${gdname}" ]; then
  224. echo -e "${lightblue}Server name:\t${default}${gdname}"
  225. elif [ -n "${servername}" ]; then
  226. echo -e "${lightblue}Server name:\t${default}${servername}"
  227. fi
  228. # Server description
  229. if [ -n "${serverdescription}" ]; then
  230. echo -e "${lightblue}Server Description:\t${default}${serverdescription}"
  231. fi
  232. # Appid
  233. if [ -n "${appid}" ]; then
  234. echo -e "${lightblue}App ID:\t${default}${appid}"
  235. fi
  236. # Branch
  237. if [ -n "${branch}" ]; then
  238. echo -e "${lightblue}Branch:\t${default}${branch}"
  239. fi
  240. # Beta Password
  241. if [ -n "${betapassword}" ]; then
  242. echo -e "${lightblue}Beta Password:\t${default}${betapassword}"
  243. fi
  244. # Server Version
  245. if [ -n "${gdversion}" ]; then
  246. echo -e "${lightblue}Server Version:\t${default}${gdversion}"
  247. fi
  248. # Server ip
  249. echo -e "${lightblue}Server IP:\t${default}${ip}:${port}"
  250. # Internet ip
  251. if [ -n "${extip}" ]; then
  252. if [ "${ip}" != "${extip}" ]; then
  253. echo -e "${lightblue}Internet IP:\t${default}${extip}:${port}"
  254. fi
  255. fi
  256. # Display ip
  257. if [ -n "${displayip}" ]; then
  258. echo -e "${lightblue}Display IP:\t${default}${displayip}:${port}"
  259. fi
  260. # Server password
  261. if [ -n "${serverpassword}" ]; then
  262. echo -e "${lightblue}Server password:\t${default}${serverpassword}"
  263. fi
  264. # Query enabled (Starbound)
  265. if [ -n "${queryenabled}" ]; then
  266. echo -e "${lightblue}Query enabled:\t${default}${queryenabled}"
  267. fi
  268. # RCON enabled (Starbound)
  269. if [ -n "${rconenabled}" ]; then
  270. echo -e "${lightblue}RCON enabled:\t${default}${rconenabled}"
  271. fi
  272. # RCON password
  273. if [ -n "${rconpassword}" ]; then
  274. echo -e "${lightblue}RCON password:\t${default}${rconpassword}"
  275. fi
  276. # RCON web (Rust)
  277. if [ -n "${rconweb}" ]; then
  278. echo -e "${lightblue}RCON web:\t${default}${rconweb}"
  279. fi
  280. # Admin password
  281. if [ -n "${adminpassword}" ]; then
  282. echo -e "${lightblue}Admin password:\t${default}${adminpassword}"
  283. fi
  284. # Stats password (Quake Live)
  285. if [ -n "${statspassword}" ]; then
  286. echo -e "${lightblue}Stats password:\t${default}${statspassword}"
  287. fi
  288. # Players
  289. if [ "${querystatus}" != "0" ]; then
  290. if [ -n "${maxplayers}" ]; then
  291. echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}"
  292. fi
  293. else
  294. if [ -n "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then
  295. echo -e "${lightblue}Players:\t${default}${gdplayers}/${gdmaxplayers}"
  296. elif [ -n "${gdplayers}" ]&&[ -n "${maxplayers}" ]; then
  297. echo -e "${lightblue}Players:\t${default}${gdplayers}/${maxplayers}"
  298. elif [ -z "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then
  299. echo -e "${lightblue}Players:\t${default}0/${gdmaxplayers}"
  300. elif [ -n "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]; then
  301. echo -e "${lightblue}Players:\t${default}${gdplayers}/∞"
  302. elif [ -z "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]&&[ -n "${maxplayers}" ]; then
  303. echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}"
  304. fi
  305. fi
  306. # Bots
  307. if [ -n "${gdbots}" ]; then
  308. echo -e "${lightblue}Bots:\t${default}${gdbots}"
  309. fi
  310. # Current map
  311. if [ -n "${gdmap}" ]; then
  312. echo -e "${lightblue}Current map:\t${default}${gdmap}"
  313. fi
  314. # Default map
  315. if [ -n "${defaultmap}" ]; then
  316. echo -e "${lightblue}Default map:\t${default}${defaultmap}"
  317. fi
  318. if [ -n "${defaultscenario}" ]; then
  319. # Current scenario (Insurgency: Sandstorm)
  320. if [ -n "${gdgamemode}" ]; then
  321. echo -e "${lightblue}Current scenario:\t${default}${gdgamemode}"
  322. fi
  323. else
  324. # Current game mode
  325. if [ -n "${gdgamemode}" ]; then
  326. echo -e "${lightblue}Current game mode:\t${default}${gdgamemode}"
  327. fi
  328. fi
  329. # Default scenario
  330. if [ -n "${defaultscenario}" ]; then
  331. echo -e "${lightblue}Default scenario:\t${default}${defaultscenario}"
  332. fi
  333. # Game type
  334. if [ -n "${gametype}" ]; then
  335. echo -e "${lightblue}Game type:\t${default}${gametype}"
  336. fi
  337. # Game mode
  338. if [ -n "${gamemode}" ]; then
  339. echo -e "${lightblue}Game mode:\t${default}${gamemode}"
  340. fi
  341. # Game world
  342. if [ -n "${gameworld}" ]; then
  343. echo -e "${lightblue}Game world:\t${default}${gameworld}"
  344. fi
  345. # Tick rate
  346. if [ -n "${tickrate}" ]; then
  347. echo -e "${lightblue}Tick rate:\t${default}${tickrate}"
  348. fi
  349. # Sharding (Don't Starve Together)
  350. if [ -n "${sharding}" ]; then
  351. echo -e "${lightblue}Sharding:\t${default}${sharding}"
  352. fi
  353. # Master (Don't Starve Together)
  354. if [ -n "${master}" ]; then
  355. echo -e "${lightblue}Master:\t${default}${master}"
  356. fi
  357. # Shard (Don't Starve Together)
  358. if [ -n "${shard}" ]; then
  359. echo -e "${lightblue}Shard:\t${default}${shard}"
  360. fi
  361. # Cluster (Don't Starve Together)
  362. if [ -n "${cluster}" ]; then
  363. echo -e "${lightblue}Cluster:\t${default}${cluster}"
  364. fi
  365. # Cave (Don't Starve Together)
  366. if [ -n "${cave}" ]; then
  367. echo -e "${lightblue}Cave:\t${default}${cave}"
  368. fi
  369. # Creativemode (Hurtworld)
  370. if [ -n "${creativemode}" ]; then
  371. echo -e "${lightblue}Creativemode:\t${default}${creativemode}"
  372. fi
  373. # TeamSpeak dbplugin
  374. if [ -n "${dbplugin}" ]; then
  375. echo -e "${lightblue}dbplugin:\t${default}${dbplugin}"
  376. fi
  377. # ASE (Multi Theft Auto)
  378. if [ -n "${ase}" ]; then
  379. echo -e "${lightblue}ASE:\t${default}${ase}"
  380. fi
  381. # Save interval (Rust)
  382. if [ -n "${saveinterval}" ]; then
  383. echo -e "${lightblue}Save interval:\t${default}${saveinterval}s"
  384. fi
  385. # Seed (Rust)
  386. if [ -n "${seed}" ]; then
  387. echo -e "${lightblue}Seed:\t${default}${seed}"
  388. fi
  389. # Salt (Rust)
  390. if [ -n "${salt}" ]; then
  391. echo -e "${lightblue}Salt:\t${default}${salt}"
  392. fi
  393. # World Size (Rust)
  394. if [ -n "${worldsize}" ]; then
  395. echo -e "${lightblue}World size:\t${default}${worldsize}m"
  396. fi
  397. # Random map rotation mode (Squad and Post Scriptum)
  398. if [ -n "${randommap}" ]; then
  399. echo -e "${lightblue}Map rotation:\t${default}${randommap}"
  400. fi
  401. # Server Version (Jedi Knight II: Jedi Outcast)
  402. if [ -n "${serverversion}" ]; then
  403. echo -e "${lightblue}Server Version:\t${default}${serverversion}"
  404. fi
  405. # authentication token (Factorio)
  406. if [ -n "${authtoken}" ]; then
  407. echo -e "${lightblue}Auth Token:\t${default}${authtoken}"
  408. fi
  409. # savegameinterval (Factorio)
  410. if [ -n "${savegameinterval}" ]; then
  411. echo -e "${lightblue}Savegame Interval:\t${default}${savegameinterval}"
  412. fi
  413. # versioncount (Factorio)
  414. if [ -n "${versioncount}" ]; then
  415. echo -e "${lightblue}Version Count:\t${default}${versioncount}"
  416. fi
  417. # Listed on Master server
  418. if [ -n "${displaymasterserver}" ]; then
  419. if [ "${displaymasterserver}" == "true" ]; then
  420. echo -e "${lightblue}Master server:\t${green}listed${default}"
  421. else
  422. echo -e "${lightblue}Master server:\t${red}not listed${default}"
  423. fi
  424. fi
  425. # Game server status
  426. if [ "${status}" == "0" ]; then
  427. echo -e "${lightblue}Status:\t${red}STOPPED${default}"
  428. else
  429. echo -e "${lightblue}Status:\t${green}STARTED${default}"
  430. fi
  431. } | column -s $'\t' -t
  432. echo -e ""
  433. }
  434. fn_info_message_script(){
  435. # csgoserver Script Details
  436. # =================================
  437. # Script name: csgoserver
  438. # LinuxGSM version: v21.1.3
  439. # glibc required: 2.18
  440. # Discord alert: off
  441. # Email alert: off
  442. # IFTTT alert: off
  443. # Mailgun (email) alert: off
  444. # Pushbullet alert: off
  445. # Pushover alert: off
  446. # Rocketchat alert: off
  447. # Slack alert: off
  448. # Telegram alert: off
  449. # Update on start: off
  450. # User: lgsm
  451. # Location: /home/lgsm/csgoserver
  452. # Config file: /home/lgsm/csgoserver/serverfiles/csgo/cfg/csgoserver.cfg
  453. echo -e "${lightgreen}${selfname} Script Details${default}"
  454. fn_messages_separator
  455. {
  456. # Script name
  457. echo -e "${lightblue}Script name:\t${default}${selfname}"
  458. # LinuxGSM version
  459. if [ -n "${version}" ]; then
  460. echo -e "${lightblue}LinuxGSM version:\t${default}${version}"
  461. fi
  462. # glibc required
  463. if [ -n "${glibc}" ]; then
  464. if [ "${glibc}" == "null" ]; then
  465. # Glibc is not required.
  466. :
  467. elif [ -z "${glibc}" ]; then
  468. echo -e "${lightblue}glibc required:\t${red}UNKNOWN${default}"
  469. elif [ "$(printf '%s\n'${glibc}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibc}" ]; then
  470. echo -e "${lightblue}glibc required:\t${red}${glibc} ${default}(${red}distro glibc ${glibcversion} too old${default})"
  471. else
  472. echo -e "${lightblue}glibc required:\t${green}${glibc}${default}"
  473. fi
  474. fi
  475. # Discord alert
  476. echo -e "${lightblue}Discord alert:\t${default}${discordalert}"
  477. # Email alert
  478. echo -e "${lightblue}Email alert:\t${default}${emailalert}"
  479. # IFTTT alert
  480. echo -e "${lightblue}IFTTT alert:\t${default}${iftttalert}"
  481. # Mailgun alert
  482. echo -e "${lightblue}Mailgun (email) alert:\t${default}${mailgunalert}"
  483. # Pushbullet alert
  484. echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}"
  485. # Pushover alert
  486. echo -e "${lightblue}Pushover alert:\t${default}${pushoveralert}"
  487. # Rocketchat alert
  488. echo -e "${lightblue}Rocketchat alert:\t${default}${rocketchatalert}"
  489. # Slack alert
  490. echo -e "${lightblue}Slack alert:\t${default}${slackalert}"
  491. # Telegram alert
  492. echo -e "${lightblue}Telegram alert:\t${default}${telegramalert}"
  493. # Update on start
  494. if [ -n "${updateonstart}" ]; then
  495. echo -e "${lightblue}Update on start:\t${default}${updateonstart}"
  496. fi
  497. # User
  498. echo -e "${lightblue}User:\t${default}$(whoami)"
  499. # Script location
  500. echo -e "${lightblue}Location:\t${default}${rootdir}"
  501. # Config file location
  502. if [ -n "${servercfgfullpath}" ]; then
  503. if [ -f "${servercfgfullpath}" ]; then
  504. echo -e "${lightblue}Config file:\t${default}${servercfgfullpath}"
  505. elif [ -d "${servercfgfullpath}" ]; then
  506. echo -e "${lightblue}Config dir:\t${default}${servercfgfullpath}"
  507. else
  508. echo -e "${lightblue}Config file:\t${default}${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})"
  509. fi
  510. fi
  511. # Network config file location (ARMA 3)
  512. if [ -n "${networkcfgfullpath}" ]; then
  513. echo -e "${lightblue}Network config file:\t${default}${networkcfgfullpath}"
  514. fi
  515. } | column -s $'\t' -t
  516. }
  517. fn_info_message_backup(){
  518. #
  519. # Backups
  520. # =================================
  521. # No. of backups: 1
  522. # Latest backup:
  523. # date: Fri May 6 18:34:19 UTC 2016
  524. # file: /home/lgsm/qlserver/backups/ql-server-2016-05-06-183239.tar.gz
  525. # size: 945M
  526. echo -e ""
  527. echo -e "${lightgreen}Backups${default}"
  528. fn_messages_separator
  529. if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
  530. echo -e "No Backups created"
  531. else
  532. {
  533. echo -e "${lightblue}No. of backups:\t${default}${backupcount}"
  534. echo -e "${lightblue}Latest backup:${default}"
  535. if [ "${lastbackupdaysago}" == "0" ]; then
  536. echo -e "${lightblue} date:\t${default}${lastbackupdate} (less than 1 day ago)"
  537. elif [ "${lastbackupdaysago}" == "1" ]; then
  538. echo -e "${lightblue} date:\t${default}${lastbackupdate} (1 day ago)"
  539. else
  540. echo -e "${lightblue} date:\t${default}${lastbackupdate} (${lastbackupdaysago} days ago)"
  541. fi
  542. echo -e "${lightblue} file:\t${default}${lastbackup}"
  543. echo -e "${lightblue} size:\t${default}${lastbackupsize}"
  544. } | column -s $'\t' -t
  545. fi
  546. }
  547. fn_info_message_commandlineparms(){
  548. #
  549. # Command-line Parameters
  550. # =================================
  551. # ./run_server_x86.sh +set net_strict 1
  552. echo -e ""
  553. echo -e "${lightgreen}Command-line Parameters${default}"
  554. fn_info_message_password_strip
  555. fn_messages_separator
  556. if [ "${serverpassword}" == "NOT SET" ]; then
  557. unset serverpassword
  558. fi
  559. fn_reload_startparameters
  560. echo -e "${preexecutable} ${executable} ${startparameters}"
  561. }
  562. fn_info_message_ports(){
  563. #
  564. # Ports
  565. # =================================
  566. # Change ports by editing the parameters in:
  567. # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg
  568. echo -e ""
  569. echo -e "${lightgreen}Ports${default}"
  570. fn_messages_separator
  571. echo -e "${lightblue}Change ports by editing the parameters in:${default}"
  572. startparameterslocation="${red}UNKNOWN${default}"
  573. # engines/games that require editing in the config file.
  574. local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "Barotrauma" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Minecraft Bedrock" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "Vintage Story" "wurm")
  575. for port_edit in "${ports_edit_array[@]}"; do
  576. if [ "${shortname}" == "ut3" ]; then
  577. startparameterslocation="${servercfgdir}/UTWeb.ini"
  578. elif [ "${shortname}" == "kf2" ]; then
  579. startparameterslocation="${servercfgdir}/LinuxServer-KFEngine.ini\n${servercfgdir}/KFWeb.ini"
  580. elif [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
  581. startparameterslocation="${servercfgfullpath}"
  582. fi
  583. done
  584. # engines/games that require editing the start parameters.
  585. local ports_edit_array=( "Avorion" "col" "goldsrc" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "qfusion" "Rust" "scpsl" "scpslsm" "Soldat" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned" "vh" )
  586. for port_edit in "${ports_edit_array[@]}"; do
  587. if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then
  588. startparameterslocation="${configdirserver}"
  589. fi
  590. done
  591. echo -e "${startparameterslocation}"
  592. echo -e ""
  593. echo -e "${lightblue}Useful port diagnostic command:${default}"
  594. }
  595. fn_info_message_statusbottom(){
  596. echo -e ""
  597. if [ "${status}" == "0" ]; then
  598. echo -e "${lightblue}Status:\t${red}STOPPED${default}"
  599. else
  600. echo -e "${lightblue}Status:\t${green}STARTED${default}"
  601. fi
  602. echo -e ""
  603. }
  604. fn_info_logs(){
  605. echo -e ""
  606. echo -e "${selfname} Logs"
  607. echo -e "================================="
  608. if [ -n "${lgsmlog}" ]; then
  609. echo -e "\nScript log\n==================="
  610. if [ ! "$(ls -A "${lgsmlogdir}")" ]; then
  611. echo -e "${lgsmlogdir} (NO LOG FILES)"
  612. elif [ ! -s "${lgsmlog}" ]; then
  613. echo -e "${lgsmlog} (LOG FILE IS EMPTY)"
  614. else
  615. echo -e "${lgsmlog}"
  616. tail -25 "${lgsmlog}"
  617. fi
  618. echo -e ""
  619. fi
  620. if [ -n "${consolelog}" ]; then
  621. echo -e "\nConsole log\n===================="
  622. if [ ! "$(ls -A "${consolelogdir}")" ]; then
  623. echo -e "${consolelogdir} (NO LOG FILES)"
  624. elif [ ! -s "${consolelog}" ]; then
  625. echo -e "${consolelog} (LOG FILE IS EMPTY)"
  626. else
  627. echo -e "${consolelog}"
  628. tail -25 "${consolelog}" | awk '{ sub("\r$", ""); print }'
  629. fi
  630. echo -e ""
  631. fi
  632. if [ -n "${gamelogdir}" ]; then
  633. echo -e "\nServer log\n==================="
  634. if [ ! "$(ls -A "${gamelogdir}")" ]; then
  635. echo -e "${gamelogdir} (NO LOG FILES)"
  636. else
  637. echo -e "${gamelogdir}"
  638. # dos2unix sed 's/\r//'
  639. tail "${gamelogdir}"/* 2>/dev/null | grep -v "==>" | sed '/^$/d' | sed 's/\r//' | tail -25
  640. fi
  641. echo -e ""
  642. fi
  643. }
  644. # Engine/Game Specific details
  645. fn_info_message_assettocorsa(){
  646. echo -e "netstat -atunp| grep acServer"
  647. echo -e ""
  648. {
  649. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  650. echo -e "> Game\tINBOUND\t${port}\tudp"
  651. echo -e "> HTTP\tINBOUND\t${port}\tudp"
  652. } | column -s $'\t' -t
  653. }
  654. fn_info_message_ark(){
  655. echo -e "netstat -atunp | grep ShooterGame"
  656. echo -e ""
  657. {
  658. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  659. echo -e "> Game\tINBOUND\t${port}\tudp"
  660. # Don't do arithmetics if ever the port wasn't a numeric value
  661. if [ "${port}" -eq "${port}" ]; then
  662. echo -e "> RAW\tINBOUND\t$((port+1))\tudp"
  663. fi
  664. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  665. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  666. } | column -s $'\t' -t
  667. }
  668. fn_info_message_avorion() {
  669. echo "netstat -atunp | grep Avorion"
  670. echo -e ""
  671. {
  672. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  673. echo -e "> Game\tINBOUND\t${port}\tudp"
  674. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  675. } | column -s $'\t' -t
  676. }
  677. fn_info_message_ballisticoverkill(){
  678. echo -e "netstat -atunp | grep BODS.x86"
  679. echo -e ""
  680. {
  681. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  682. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  683. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  684. } | column -s $'\t' -t
  685. }
  686. fn_info_message_battalion1944(){
  687. echo -e "netstat -atunp | grep BattalionServ"
  688. echo -e ""
  689. {
  690. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  691. echo -e "> Game\tINBOUND\t${port}\tudp"
  692. # Don't do arithmetics if ever the port wasn't a numeric value
  693. # unconfirmed - http://wiki.battaliongame.com/Community_Servers#Firewalls_.2F_Port_Forwarding
  694. if [ "${port}" -eq "${port}" ]; then
  695. echo -e "> Steam\tINBOUND\t$((port+1))\tudp"
  696. echo -e "> Unused\tINBOUND\t$((port+2))\ttcp"
  697. fi
  698. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  699. } | column -s $'\t' -t
  700. }
  701. fn_info_message_cod(){
  702. echo -e "netstat -atunp | grep cod_lnxded"
  703. echo -e ""
  704. {
  705. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  706. echo -e "> Game\tINBOUND\t${port}\tudp"
  707. } | column -s $'\t' -t
  708. }
  709. fn_info_message_coduo(){
  710. echo -e "netstat -atunp | grep coduo_lnxded"
  711. echo -e ""
  712. {
  713. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  714. echo -e "> Game\tINBOUND\t${port}\tudp"
  715. } | column -s $'\t' -t
  716. }
  717. fn_info_message_chivalry(){
  718. fn_info_message_password_strip
  719. echo -e "netstat -atunp | grep UDKGame"
  720. echo -e ""
  721. {
  722. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  723. echo -e "> Game\tINBOUND\t${port}\tudp"
  724. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  725. echo -e "> RCON\tINBOUND\t27960\ttcp"
  726. } | column -s $'\t' -t
  727. }
  728. fn_info_message_cod2(){
  729. echo -e "netstat -atunp | grep cod2_lnxded"
  730. echo -e ""
  731. {
  732. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  733. echo -e "> Game\tINBOUND\t${port}\tudp"
  734. } | column -s $'\t' -t
  735. }
  736. fn_info_message_cod4(){
  737. echo -e "netstat -atunp"
  738. echo -e ""
  739. {
  740. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  741. echo -e "> Game\tINBOUND\t${port}\tudp"
  742. } | column -s $'\t' -t
  743. }
  744. fn_info_message_codwaw(){
  745. echo -e "netstat -atunp | grep codwaw_lnxded"
  746. echo -e ""
  747. {
  748. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  749. echo -e "> Game\tINBOUND\t${port}\tudp"
  750. } | column -s $'\t' -t
  751. }
  752. fn_info_message_dst(){
  753. echo -e "netstat -atunp | grep dontstarve"
  754. echo -e ""
  755. {
  756. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  757. echo -e "> Game: Server\tINBOUND\t${port}\tudp"
  758. echo -e "> Game: Master\tINBOUND\t${masterport}\tudp"
  759. echo -e "> Steam: Auth\tINBOUND\t${steamauthenticationport}\tudp"
  760. echo -e "> Steam: Master\tINBOUND\t${steammasterserverport}\tudp"
  761. } | column -s $'\t' -t
  762. }
  763. fn_info_message_eco(){
  764. echo -e "netstat -atunp | grep EcoServer"
  765. echo -e ""
  766. {
  767. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  768. echo -e "> Game\tINBOUND\t${port}\tudp"
  769. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp"
  770. } | column -s $'\t' -t
  771. }
  772. fn_info_message_etlegacy(){
  773. echo -e "netstat -atunp | grep etlded"
  774. echo -e ""
  775. {
  776. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  777. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  778. } | column -s $'\t' -t
  779. }
  780. fn_info_message_factorio(){
  781. echo -e "netstat -atunp | grep factorio"
  782. echo -e ""
  783. {
  784. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  785. echo -e "> Game\tINBOUND\t${port}\tudp"
  786. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  787. } | column -s $'\t' -t
  788. }
  789. fn_info_message_goldsrc(){
  790. echo -e "netstat -atunp | grep hlds_linux"
  791. echo -e ""
  792. {
  793. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  794. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  795. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  796. } | column -s $'\t' -t
  797. }
  798. fn_info_message_hurtworld(){
  799. echo -e "netstat -atunp | grep Hurtworld"
  800. echo -e ""
  801. {
  802. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  803. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  804. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  805. } | column -s $'\t' -t
  806. }
  807. fn_info_message_inss(){
  808. echo -e "netstat -atunp | grep Insurgency"
  809. echo -e ""
  810. {
  811. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  812. echo -e "> Game\tINBOUND\t${port}\tudp"
  813. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  814. if [ -n "${rconport}" ]; then
  815. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  816. fi
  817. } | column -s $'\t' -t
  818. }
  819. fn_info_message_jk2(){
  820. echo -e "netstat -atunp | grep jk2mvded"
  821. echo -e ""
  822. {
  823. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  824. echo -e "> Game\tINBOUND\t${port}\tudp"
  825. } | column -s $'\t' -t
  826. }
  827. fn_info_message_justcause2(){
  828. echo -e "netstat -atunp | grep Jcmp-Server"
  829. echo -e ""
  830. {
  831. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  832. echo -e "> Game\tINBOUND\t${port}\tudp"
  833. } | column -s $'\t' -t
  834. }
  835. fn_info_message_justcause3(){
  836. echo -e "netstat -atunp | grep Server"
  837. echo -e ""
  838. {
  839. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  840. echo -e "> Game\tINBOUND\t${port}\tudp"
  841. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  842. echo -e "> Steam\tINBOUND\t${steamport}\tudp"
  843. } | column -s $'\t' -t
  844. }
  845. fn_info_message_minecraft(){
  846. echo -e "netstat -atunp | grep java"
  847. echo -e ""
  848. {
  849. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  850. echo -e "> Game\tINBOUND\t${port}\ttcp"
  851. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  852. echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
  853. } | column -s $'\t' -t
  854. }
  855. fn_info_message_minecraft_bedrock(){
  856. echo -e "netstat -atunp | grep bedrock_serv"
  857. echo -e ""
  858. {
  859. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  860. echo -e "> Game\tINBOUND\t${port}\tudp"
  861. echo -e "> Game\tINBOUND\t${port6}\tudp6"
  862. } | column -s $'\t' -t
  863. }
  864. fn_info_message_onset(){
  865. echo -e "netstat -atunp | grep OnsetServer"
  866. echo -e ""
  867. {
  868. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  869. echo -e "> Game\tINBOUND\t${port}\tudp"
  870. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  871. echo -e "> HTTP\tINBOUND\t${httpport}\ttcp"
  872. } | column -s $'\t' -t
  873. }
  874. fn_info_message_mohaa(){
  875. echo -e "netstat -atunp | grep mohaa_lnxded"
  876. echo -e ""
  877. {
  878. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  879. echo -e "> Game\tINBOUND\t${port}\tudp"
  880. } | column -s $'\t' -t
  881. }
  882. fn_info_message_mom(){
  883. echo -e "netstat -atunp | grep MemoriesOfMar"
  884. echo -e ""
  885. {
  886. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  887. echo -e "> Game\tINBOUND\t${port}\tudp"
  888. echo -e "> BeaconPort\tINBOUND\t${beaconport}\tudp"
  889. } | column -s $'\t' -t
  890. }
  891. fn_info_message_mumble(){
  892. echo -e "netstat -atunp | grep murmur"
  893. echo -e ""
  894. {
  895. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  896. echo -e "> Voice\tINBOUND\t${port}\tudp"
  897. echo -e "> ServerQuery\tINBOUND\t${port}\ttcp"
  898. } | column -s $'\t' -t
  899. }
  900. fn_info_message_pstbs(){
  901. echo -e "netstat -atunp | grep PostScriptum"
  902. echo -e ""
  903. {
  904. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  905. echo -e "> Game\tINBOUND\t${port}\tudp"
  906. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  907. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  908. } | column -s $'\t' -t
  909. }
  910. fn_info_message_projectcars(){
  911. echo -e "netstat -atunp | grep DedicatedS"
  912. echo -e ""
  913. {
  914. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  915. echo -e "> Game\tINBOUND\t${port}\tudp"
  916. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  917. echo -e "> Steam\tINBOUND\t${steamport}\tudp"
  918. } | column -s $'\t' -t
  919. }
  920. fn_info_message_projectzomboid(){
  921. echo -e "netstat -atunp | grep ProjectZomb"
  922. echo -e ""
  923. {
  924. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  925. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  926. } | column -s $'\t' -t
  927. }
  928. fn_info_message_quake(){
  929. echo -e "netstat -atunp | grep mvdsv"
  930. echo -e ""
  931. {
  932. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  933. echo -e "> Game\tINBOUND\t${port}\tudp"
  934. } | column -s $'\t' -t
  935. }
  936. fn_info_message_quake2(){
  937. echo -e "netstat -atunp | grep quake2"
  938. echo -e ""
  939. {
  940. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  941. echo -e "> Game\tINBOUND\t${port}\tudp"
  942. } | column -s $'\t' -t
  943. }
  944. fn_info_message_quake3(){
  945. echo -e "netstat -atunp | grep q3ded"
  946. echo -e ""
  947. {
  948. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  949. echo -e "> Game\tINBOUND\t${port}\tudp"
  950. } | column -s $'\t' -t
  951. }
  952. fn_info_message_quakelive(){
  953. echo -e "netstat -atunp | grep qzeroded"
  954. echo -e ""
  955. if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then
  956. echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}."
  957. echo -e ""
  958. fi
  959. {
  960. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  961. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  962. echo -e "> Rcon\tINBOUND\t${rconport}\tudp"
  963. echo -e "> Stats\tINBOUND\t${statsport}\tudp"
  964. } | column -s $'\t' -t
  965. }
  966. fn_info_message_arma3(){
  967. echo -e "netstat -atunp | grep arma3server"
  968. echo -e ""
  969. # Default port
  970. if [ -z "${port}" ]; then
  971. port="2302"
  972. fi
  973. {
  974. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  975. echo -e "> Game\tINBOUND\t${port}\tudp"
  976. # Don't do arithmetics if ever the port wasn't a numeric value
  977. if [ "${port}" -eq "${port}" ]; then
  978. echo -e "> Query Steam\tINBOUND\t$((port+1))\tudp"
  979. echo -e "> Steam: Master traffic\tINBOUND\t$((port+2))\tudp"
  980. echo -e "> Undocumented Port\tINBOUND\t$((port+3))\tudp"
  981. fi
  982. } | column -s $'\t' -t
  983. }
  984. fn_info_message_bf1942(){
  985. echo -e "netstat -atunp | grep bf1942_lnxd"
  986. echo -e ""
  987. {
  988. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  989. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  990. echo -e "> Query Steam\tINBOUND\t${queryport}\tudp"
  991. } | column -s $'\t' -t
  992. }
  993. fn_info_message_bfv(){
  994. echo -e "netstat -atunp | grep bfv_linded"
  995. echo -e ""
  996. {
  997. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  998. echo -e "> Game\tINBOUND\t${port}\tudp"
  999. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1000. } | column -s $'\t' -t
  1001. }
  1002. fn_info_message_risingworld(){
  1003. echo -e "netstat -atunp | grep java"
  1004. echo -e ""
  1005. {
  1006. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1007. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  1008. echo -e "> Query HTTP\tINBOUND\t${httpqueryport}\ttcp"
  1009. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  1010. } | column -s $'\t' -t
  1011. }
  1012. fn_info_message_rtcw(){
  1013. echo -e "netstat -atunp | grep iowolfded"
  1014. echo -e ""
  1015. {
  1016. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1017. echo -e "> Game\tINBOUND\t${port}\tudp"
  1018. } | column -s $'\t' -t
  1019. }
  1020. fn_info_message_rust(){
  1021. echo -e "netstat -atunp | grep Rust"
  1022. echo -e ""
  1023. {
  1024. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1025. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  1026. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  1027. echo -e "> App\tINBOUND\t${appport}\ttcp"
  1028. } | column -s $'\t' -t
  1029. }
  1030. fn_info_message_samp(){
  1031. echo -e "netstat -atunp | grep samp03svr"
  1032. echo -e ""
  1033. {
  1034. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1035. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  1036. } | column -s $'\t' -t
  1037. }
  1038. fn_info_message_sbots(){
  1039. echo -e "netstat -atunp | grep blank1"
  1040. echo -e ""
  1041. {
  1042. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1043. echo -e "> Game\tINBOUND\t${port}\tudp"
  1044. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1045. } | column -s $'\t' -t
  1046. }
  1047. fn_info_message_sdtd(){
  1048. fn_info_message_password_strip
  1049. echo -e "netstat -atunp | grep 7DaysToDie"
  1050. echo -e ""
  1051. {
  1052. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1053. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  1054. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1055. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp"
  1056. echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
  1057. } | column -s $'\t' -t
  1058. echo -e ""
  1059. echo -e "${lightgreen}${gamename} Web Admin${default}"
  1060. fn_messages_separator
  1061. {
  1062. echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
  1063. echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
  1064. echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
  1065. } | column -s $'\t' -t
  1066. echo -e ""
  1067. echo -e "${lightgreen}${gamename} Telnet${default}"
  1068. fn_messages_separator
  1069. {
  1070. echo -e "${lightblue}Telnet enabled:\t${default}${telnetenabled}"
  1071. echo -e "${lightblue}Telnet address:\t${default}${telnetip} ${telnetport}"
  1072. echo -e "${lightblue}Telnet password:\t${default}${telnetpass}"
  1073. } | column -s $'\t' -t
  1074. }
  1075. fn_info_message_sof2(){
  1076. echo -e "netstat -atunp | grep sof2ded"
  1077. echo -e ""
  1078. {
  1079. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1080. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  1081. } | column -s $'\t' -t
  1082. }
  1083. fn_info_message_source(){
  1084. echo -e "netstat -atunp | grep srcds_linux"
  1085. echo -e ""
  1086. {
  1087. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1088. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  1089. echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp"
  1090. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  1091. } | column -s $'\t' -t
  1092. }
  1093. fn_info_message_spark(){
  1094. fn_info_message_password_strip
  1095. echo -e "netstat -atunp | grep server_linux"
  1096. echo -e ""
  1097. {
  1098. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1099. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  1100. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1101. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp"
  1102. } | column -s $'\t' -t
  1103. echo -e ""
  1104. echo -e "${lightgreen}${servername} Web Admin${default}"
  1105. fn_messages_separator
  1106. {
  1107. echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}/index.html"
  1108. echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
  1109. echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
  1110. } | column -s $'\t' -t
  1111. }
  1112. fn_info_message_squad(){
  1113. echo -e "netstat -atunp | grep SquadServer"
  1114. echo -e ""
  1115. {
  1116. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1117. echo -e "> Game\tINBOUND\t${port}\tudp"
  1118. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1119. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  1120. } | column -s $'\t' -t
  1121. }
  1122. fn_info_message_starbound(){
  1123. echo -e "netstat -atunp | grep starbound"
  1124. echo -e ""
  1125. {
  1126. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1127. echo -e "> Game\tINBOUND\t${port}\ttcp"
  1128. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  1129. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  1130. } | column -s $'\t' -t
  1131. }
  1132. fn_info_message_stationeers(){
  1133. echo -e "netstat -atunp | grep rocketstation"
  1134. echo -e ""
  1135. {
  1136. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1137. echo -e "> Game\tINBOUND\t${port}\ttcp"
  1138. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  1139. } | column -s $'\t' -t
  1140. }
  1141. fn_info_message_teamspeak3(){
  1142. echo -e "netstat -atunp | grep ts3server"
  1143. echo -e ""
  1144. {
  1145. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1146. echo -e "> Voice\tINBOUND\t${port}\tudp"
  1147. echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp"
  1148. echo -e "> File transfer\tINBOUND\t${fileport}\ttcp"
  1149. } | column -s $'\t' -t
  1150. }
  1151. fn_info_message_teeworlds(){
  1152. echo -e "netstat -atunp | grep teeworlds"
  1153. echo -e ""
  1154. {
  1155. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1156. echo -e "> Game\Query\tINBOUND\t${port}\ttcp"
  1157. } | column -s $'\t' -t
  1158. }
  1159. fn_info_message_terraria(){
  1160. echo -e "netstat -atunp | grep Terraria"
  1161. echo -e ""
  1162. {
  1163. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1164. echo -e "> Game\tINBOUND\t${port}\ttcp"
  1165. } | column -s $'\t' -t
  1166. }
  1167. fn_info_message_towerunite(){
  1168. echo -e "netstat -atunp | grep TowerServer"
  1169. echo -e ""
  1170. {
  1171. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1172. echo -e "> Game\tINBOUND\t${port}\ttcp"
  1173. # Don't do arithmetics if ever the port wasn't a numeric value
  1174. if [ "${port}" -eq "${port}" ]; then
  1175. echo -e "> Steam\tINBOUND\t$((port+1))\tudp"
  1176. fi
  1177. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1178. } | column -s $'\t' -t
  1179. }
  1180. fn_info_message_unreal(){
  1181. fn_info_message_password_strip
  1182. echo -e "netstat -atunp | grep ucc-bin"
  1183. echo -e ""
  1184. {
  1185. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  1186. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  1187. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1188. if [ "${engine}" == "unreal" ]; then
  1189. echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp"
  1190. fi
  1191. if [ "${engine}" != "unreal" ]&&[ "${appid}" != "223250" ]; then
  1192. echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}"
  1193. fi
  1194. if [ "${appid}" == "215360" ]; then
  1195. echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp"
  1196. else
  1197. echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp"
  1198. fi
  1199. if [ "${appid}" ]; then
  1200. if [ "${appid}" == "223250" ]; then
  1201. echo -e "> Steam\tINBOUND\t20610\tudp"
  1202. else
  1203. echo -e "> Steam\tINBOUND\t20660\tudp"
  1204. fi
  1205. fi
  1206. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  1207. } | column -s $'\t' -t
  1208. echo -e ""
  1209. echo -e "${lightgreen}${servername} Web Admin${default}"
  1210. fn_messages_separator
  1211. {
  1212. echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
  1213. echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
  1214. echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
  1215. echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
  1216. } | column -s $'\t' -t
  1217. }
  1218. fn_info_message_unreal2(){
  1219. fn_info_message_password_strip
  1220. echo -e "netstat -atunp | grep ucc-bin"
  1221. echo -e ""
  1222. {
  1223. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  1224. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  1225. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1226. if [ "${appid}" != "223250" ]; then
  1227. echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}"
  1228. fi
  1229. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  1230. } | column -s $'\t' -t
  1231. echo -e ""
  1232. echo -e "${lightgreen}${servername} Web Admin${default}"
  1233. fn_messages_separator
  1234. {
  1235. echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
  1236. echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
  1237. echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
  1238. echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
  1239. } | column -s $'\t' -t
  1240. }
  1241. fn_info_message_unreal3(){
  1242. fn_info_message_password_strip
  1243. echo -e "netstat -atunp | grep ut3-bin"
  1244. echo -e ""
  1245. {
  1246. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1247. echo -e "> Game\tINBOUND\t${port}\tudp"
  1248. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1249. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  1250. } | column -s $'\t' -t
  1251. echo -e ""
  1252. echo -e "${lightgreen}${servername} Web Admin${default}"
  1253. fn_messages_separator
  1254. {
  1255. echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
  1256. echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
  1257. echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
  1258. echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
  1259. } | column -s $'\t' -t
  1260. }
  1261. fn_info_message_unturned(){
  1262. echo -e "netstat -atunp | grep Unturned"
  1263. echo -e ""
  1264. {
  1265. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1266. echo -e "> Game\tINBOUND\t${port}\tudp"
  1267. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1268. } | column -s $'\t' -t
  1269. }
  1270. fn_info_message_ut(){
  1271. echo -e "netstat -atunp | grep UE4Server"
  1272. echo -e ""
  1273. {
  1274. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1275. echo -e "> Game\tINBOUND\t${port}\tudp"
  1276. } | column -s $'\t' -t
  1277. }
  1278. fn_info_message_vh(){
  1279. echo -e "netstat -atunp | grep valheim"
  1280. echo -e ""
  1281. {
  1282. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1283. echo -e "> Game\tINBOUND\t${port}\tudp"
  1284. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1285. } | column -s $'\t' -t
  1286. }
  1287. fn_info_message_kf2(){
  1288. fn_info_message_password_strip
  1289. echo -e "netstat -atunp | grep KFGame"
  1290. echo -e ""
  1291. {
  1292. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1293. echo -e "> Game\tINBOUND\t${port}\ttcp\tPort=${port}"
  1294. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1295. echo -e "> Steam\tINBOUND\t20560\tudp"
  1296. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  1297. } | column -s $'\t' -t
  1298. echo -e ""
  1299. echo -e "${lightgreen}${servername} Web Admin${default}"
  1300. fn_messages_separator
  1301. {
  1302. echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
  1303. echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
  1304. echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
  1305. echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
  1306. } | column -s $'\t' -t
  1307. }
  1308. fn_info_message_wolfensteinenemyterritory(){
  1309. echo -e "netstat -atunp | grep etded"
  1310. echo -e ""
  1311. {
  1312. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1313. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  1314. } | column -s $'\t' -t
  1315. }
  1316. fn_info_message_wurmunlimited(){
  1317. echo -e "netstat -atunp | grep WurmServer"
  1318. echo -e ""
  1319. {
  1320. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1321. echo -e "> Game\tINBOUND\t${port}\ttcp"
  1322. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1323. } | column -s $'\t' -t
  1324. }
  1325. fn_info_message_mta(){
  1326. echo -e "netstat -atunp | grep mta-server"
  1327. echo -e ""
  1328. {
  1329. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1330. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  1331. echo -e "> HTTP Server\tINBOUND\t${httpport}\ttcp"
  1332. if [ "${ase}" == "Enabled" ]; then
  1333. echo -e "> Query Port\tOUTBOUND\t${queryport}\tudp"
  1334. fi
  1335. } | column -s $'\t' -t
  1336. }
  1337. fn_info_message_mordhau(){
  1338. echo -e "netstat -atunp | grep Mord"
  1339. echo -e ""
  1340. {
  1341. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1342. echo -e "> Game\tINBOUND\t${port}\tudp"
  1343. echo -e "> BeaconPort\tINBOUND\t${beaconport}\tudp"
  1344. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1345. } | column -s $'\t' -t
  1346. }
  1347. fn_info_message_barotrauma(){
  1348. echo -e "netstat -atunp | grep /./Server.bin"
  1349. echo -e ""
  1350. {
  1351. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1352. echo -e "> Game\tINBOUND\t${port}\tudp"
  1353. echo -e "> Query\tINBOUND\t$((port+1))\tudp"
  1354. } | column -s $'\t' -t
  1355. }
  1356. fn_info_message_soldat() {
  1357. echo -e "netstat -atunp | grep soldat"
  1358. echo -e ""
  1359. {
  1360. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1361. echo -e "> Game\tINBOUND\t${port}\tudp"
  1362. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1363. echo -e "> FILES\tINBOUND\t$((port+10))\ttcp"
  1364. } | column -s $'\t' -t
  1365. }
  1366. fn_info_message_warfork(){
  1367. echo -e "netstat -atunp | grep wf_server"
  1368. echo -e ""
  1369. {
  1370. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1371. echo -e "> Game\tINBOUND\t${port}\tudp"
  1372. echo -e "> HTTP\tINBOUND\t${httpport}\ttcp"
  1373. } | column -s $'\t' -t
  1374. }
  1375. fn_info_message_pavlovvr(){
  1376. echo "netstat -atunp | grep Pavlov"
  1377. echo -e ""
  1378. {
  1379. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  1380. echo -e "> Game\tINBOUND\t${port}\tudp"
  1381. echo -e "> Game\tINBOUND\t$((port+400))\tudp"
  1382. } | column -s $'\t' -t
  1383. }
  1384. fn_info_message_colony(){
  1385. echo -e "netstat -atunp | grep colonyserv"
  1386. echo -e ""
  1387. {
  1388. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1389. echo -e "> Game\tINBOUND\t${port}\tudp"
  1390. echo -e "> Steam\tINBOUND\t${steamport}\tudp"
  1391. } | column -s $'\t' -t
  1392. }
  1393. fn_info_message_vintagestory(){
  1394. echo "netstat -atunp | grep cli"
  1395. echo -e ""
  1396. {
  1397. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  1398. echo -e "> Game\tINBOUND\t${port}\tTCP"
  1399. } | column -s $'\t' -t
  1400. }
  1401. fn_info_message_scpsl(){
  1402. echo -e "netstat -atunp | grep SCPSL"
  1403. echo -e ""
  1404. {
  1405. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1406. echo -e "> Game\tINBOUND\t${port}\tudp"
  1407. } | column -s $'\t' -t
  1408. }
  1409. fn_info_message_select_engine(){
  1410. # Display details depending on game or engine.
  1411. if [ "${shortname}" == "ac" ]; then
  1412. fn_info_message_assettocorsa
  1413. elif [ "${shortname}" == "ark" ]; then
  1414. fn_info_message_ark
  1415. elif [ "${shortname}" == "av" ]; then
  1416. fn_info_message_avorion
  1417. elif [ "${shortname}" == "arma3" ]; then
  1418. fn_info_message_arma3
  1419. elif [ "${shortname}" == "bf1942" ]; then
  1420. fn_info_message_bf1942
  1421. elif [ "${shortname}" == "bfv" ]; then
  1422. fn_info_message_bfv
  1423. elif [ "${shortname}" == "bo" ]; then
  1424. fn_info_message_ballisticoverkill
  1425. elif [ "${shortname}" == "bt" ]; then
  1426. fn_info_message_barotrauma
  1427. elif [ "${shortname}" == "bt1944" ]; then
  1428. fn_info_message_battalion1944
  1429. elif [ "${shortname}" == "cmw" ]; then
  1430. fn_info_message_chivalry
  1431. elif [ "${shortname}" == "cod" ]; then
  1432. fn_info_message_cod
  1433. elif [ "${shortname}" == "coduo" ]; then
  1434. fn_info_message_coduo
  1435. elif [ "${shortname}" == "cod2" ]; then
  1436. fn_info_message_cod2
  1437. elif [ "${shortname}" == "cod4" ]; then
  1438. fn_info_message_cod4
  1439. elif [ "${shortname}" == "codwaw" ]; then
  1440. fn_info_message_codwaw
  1441. elif [ "${shortname}" == "col" ]; then
  1442. fn_info_message_colony
  1443. elif [ "${shortname}" == "dst" ]; then
  1444. fn_info_message_dst
  1445. elif [ "${shortname}" == "eco" ]; then
  1446. fn_info_message_eco
  1447. elif [ "${shortname}" == "etl" ]; then
  1448. fn_info_message_etlegacy
  1449. elif [ "${shortname}" == "fctr" ]; then
  1450. fn_info_message_factorio
  1451. elif [ "${shortname}" == "hw" ]; then
  1452. fn_info_message_hurtworld
  1453. elif [ "${shortname}" == "inss" ]; then
  1454. fn_info_message_inss
  1455. elif [ "${shortname}" == "jk2" ]; then
  1456. fn_info_message_jk2
  1457. elif [ "${shortname}" == "jc2" ]; then
  1458. fn_info_message_justcause2
  1459. elif [ "${shortname}" == "jc3" ]; then
  1460. fn_info_message_justcause3
  1461. elif [ "${shortname}" == "kf2" ]; then
  1462. fn_info_message_kf2
  1463. elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]; then
  1464. fn_info_message_minecraft
  1465. elif [ "${shortname}" == "mcb" ]; then
  1466. fn_info_message_minecraft_bedrock
  1467. elif [ "${shortname}" == "mh" ]; then
  1468. fn_info_message_mordhau
  1469. elif [ "${shortname}" == "mohaa" ]; then
  1470. fn_info_message_mohaa
  1471. elif [ "${shortname}" == "mta" ]; then
  1472. fn_info_message_mta
  1473. elif [ "${shortname}" == "mumble" ]; then
  1474. fn_info_message_mumble
  1475. elif [ "${shortname}" == "onset" ]; then
  1476. fn_info_message_onset
  1477. elif [ "${shortname}" == "mom" ]; then
  1478. fn_info_message_mom
  1479. elif [ "${shortname}" == "pz" ]; then
  1480. fn_info_message_projectzomboid
  1481. elif [ "${shortname}" == "pstbs" ]; then
  1482. fn_info_message_pstbs
  1483. elif [ "${shortname}" == "pc" ]; then
  1484. fn_info_message_projectcars
  1485. elif [ "${shortname}" == "qw" ]; then
  1486. fn_info_message_quake
  1487. elif [ "${shortname}" == "q2" ]; then
  1488. fn_info_message_quake2
  1489. elif [ "${shortname}" == "q3" ]; then
  1490. fn_info_message_quake3
  1491. elif [ "${shortname}" == "ql" ]; then
  1492. fn_info_message_quakelive
  1493. elif [ "${shortname}" == "samp" ]; then
  1494. fn_info_message_samp
  1495. elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then
  1496. fn_info_message_scpsl
  1497. elif [ "${shortname}" == "sdtd" ]; then
  1498. fn_info_message_sdtd
  1499. elif [ "${shortname}" == "squad" ]; then
  1500. fn_info_message_squad
  1501. elif [ "${shortname}" == "st" ]; then
  1502. fn_info_message_stationeers
  1503. elif [ "${shortname}" == "sof2" ]; then
  1504. fn_info_message_sof2
  1505. elif [ "${shortname}" == "sol" ]; then
  1506. fn_info_message_soldat
  1507. elif [ "${shortname}" == "sb" ]; then
  1508. fn_info_message_starbound
  1509. elif [ "${shortname}" == "sbots" ]; then
  1510. fn_info_message_sbots
  1511. elif [ "${shortname}" == "terraria" ]; then
  1512. fn_info_message_terraria
  1513. elif [ "${shortname}" == "ts3" ]; then
  1514. fn_info_message_teamspeak3
  1515. elif [ "${shortname}" == "tu" ]; then
  1516. fn_info_message_towerunite
  1517. elif [ "${shortname}" == "tw" ]; then
  1518. fn_info_message_teeworlds
  1519. elif [ "${shortname}" == "unt" ]; then
  1520. fn_info_message_unturned
  1521. elif [ "${shortname}" == "ut" ]; then
  1522. fn_info_message_ut
  1523. elif [ "${shortname}" == "vh" ]; then
  1524. fn_info_message_vh
  1525. elif [ "${shortname}" == "rtcw" ]; then
  1526. fn_info_message_rtcw
  1527. elif [ "${shortname}" == "pvr" ]; then
  1528. fn_info_message_pavlovvr
  1529. elif [ "${shortname}" == "rust" ]; then
  1530. fn_info_message_rust
  1531. elif [ "${shortname}" == "vints" ]; then
  1532. fn_info_message_vintagestory
  1533. elif [ "${shortname}" == "wf" ]; then
  1534. fn_info_message_warfork
  1535. elif [ "${shortname}" == "wurm" ]; then
  1536. fn_info_message_wurmunlimited
  1537. elif [ "${shortname}" == "rw" ]; then
  1538. fn_info_message_risingworld
  1539. elif [ "${shortname}" == "wet" ]; then
  1540. fn_info_message_wolfensteinenemyterritory
  1541. elif [ "${engine}" == "goldsrc" ]; then
  1542. fn_info_message_goldsrc
  1543. elif [ "${engine}" == "source" ]; then
  1544. fn_info_message_source
  1545. elif [ "${engine}" == "spark" ]; then
  1546. fn_info_message_spark
  1547. elif [ "${engine}" == "unreal" ]; then
  1548. fn_info_message_unreal
  1549. elif [ "${engine}" == "unreal2" ]; then
  1550. fn_info_message_unreal2
  1551. elif [ "${engine}" == "unreal3" ]; then
  1552. fn_info_message_unreal3
  1553. else
  1554. fn_print_error_nl "Unable to detect server engine."
  1555. fi
  1556. }