info_messages.sh 49 KB

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