info_messages.sh 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700
  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. if grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/secrets-${selfname}.cfg"; then
  541. eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/secrets-${selfname}.cfg")"
  542. elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/${selfname}.cfg"; then
  543. eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/${selfname}.cfg")"
  544. elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/secrets-common.cfg"; then
  545. eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/secrets-common.cfg")"
  546. elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/common.cfg"; then
  547. eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/common.cfg")"
  548. elif grep -qE "^[[:blank:]]*startparameters=" "${configdirserver}/_default.cfg"; then
  549. eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/_default.cfg")"
  550. fi
  551. echo -e "${preexecutable} ${executable} ${startparameters}"
  552. }
  553. fn_info_message_ports(){
  554. #
  555. # Ports
  556. # =================================
  557. # Change ports by editing the parameters in:
  558. # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg
  559. echo -e ""
  560. echo -e "${lightgreen}Ports${default}"
  561. fn_messages_separator
  562. echo -e "${lightblue}Change ports by editing the parameters in:${default}"
  563. startparameterslocation="${red}UNKNOWN${default}"
  564. # engines/games that require editing in the config file.
  565. 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")
  566. for port_edit in "${ports_edit_array[@]}"; do
  567. if [ "${shortname}" == "ut3" ]; then
  568. startparameterslocation="${servercfgdir}/UTWeb.ini"
  569. elif [ "${shortname}" == "kf2" ]; then
  570. startparameterslocation="${servercfgdir}/LinuxServer-KFEngine.ini\n${servercfgdir}/KFWeb.ini"
  571. elif [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
  572. startparameterslocation="${servercfgfullpath}"
  573. fi
  574. done
  575. # engines/games that require editing the start parameters.
  576. local ports_edit_array=( "Avorion" "col" "goldsrc" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "qfusion" "Rust" "scpsl" "scpslsm" "Soldat" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned" "vh" )
  577. for port_edit in "${ports_edit_array[@]}"; do
  578. if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then
  579. startparameterslocation="${configdirserver}"
  580. fi
  581. done
  582. echo -e "${startparameterslocation}"
  583. echo -e ""
  584. echo -e "${lightblue}Useful port diagnostic command:${default}"
  585. }
  586. fn_info_message_statusbottom(){
  587. echo -e ""
  588. if [ "${status}" == "0" ]; then
  589. echo -e "${lightblue}Status:\t${red}STOPPED${default}"
  590. else
  591. echo -e "${lightblue}Status:\t${green}STARTED${default}"
  592. fi
  593. echo -e ""
  594. }
  595. fn_info_logs(){
  596. echo -e ""
  597. echo -e "${selfname} Logs"
  598. echo -e "================================="
  599. if [ -n "${lgsmlog}" ]; then
  600. echo -e "\nScript log\n==================="
  601. if [ ! "$(ls -A "${lgsmlogdir}")" ]; then
  602. echo -e "${lgsmlogdir} (NO LOG FILES)"
  603. elif [ ! -s "${lgsmlog}" ]; then
  604. echo -e "${lgsmlog} (LOG FILE IS EMPTY)"
  605. else
  606. echo -e "${lgsmlog}"
  607. tail -25 "${lgsmlog}"
  608. fi
  609. echo -e ""
  610. fi
  611. if [ -n "${consolelog}" ]; then
  612. echo -e "\nConsole log\n===================="
  613. if [ ! "$(ls -A "${consolelogdir}")" ]; then
  614. echo -e "${consolelogdir} (NO LOG FILES)"
  615. elif [ ! -s "${consolelog}" ]; then
  616. echo -e "${consolelog} (LOG FILE IS EMPTY)"
  617. else
  618. echo -e "${consolelog}"
  619. tail -25 "${consolelog}" | awk '{ sub("\r$", ""); print }'
  620. fi
  621. echo -e ""
  622. fi
  623. if [ -n "${gamelogdir}" ]; then
  624. echo -e "\nServer log\n==================="
  625. if [ ! "$(ls -A "${gamelogdir}")" ]; then
  626. echo -e "${gamelogdir} (NO LOG FILES)"
  627. else
  628. echo -e "${gamelogdir}"
  629. # dos2unix sed 's/\r//'
  630. tail "${gamelogdir}"/* 2>/dev/null | grep -v "==>" | sed '/^$/d' | sed 's/\r//' | tail -25
  631. fi
  632. echo -e ""
  633. fi
  634. }
  635. # Engine/Game Specific details
  636. fn_info_message_assettocorsa(){
  637. echo -e "netstat -atunp| grep acServer"
  638. echo -e ""
  639. {
  640. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  641. echo -e "> Game\tINBOUND\t${port}\tudp"
  642. echo -e "> HTTP\tINBOUND\t${port}\tudp"
  643. } | column -s $'\t' -t
  644. }
  645. fn_info_message_ark(){
  646. echo -e "netstat -atunp | grep ShooterGame"
  647. echo -e ""
  648. {
  649. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  650. echo -e "> Game\tINBOUND\t${port}\tudp"
  651. # Don't do arithmetics if ever the port wasn't a numeric value
  652. if [ "${port}" -eq "${port}" ]; then
  653. echo -e "> RAW\tINBOUND\t$((port+1))\tudp"
  654. fi
  655. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  656. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  657. } | column -s $'\t' -t
  658. }
  659. fn_info_message_avorion() {
  660. echo "netstat -atunp | grep Avorion"
  661. echo -e ""
  662. {
  663. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  664. echo -e "> Game\tINBOUND\t${port}\tudp"
  665. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  666. } | column -s $'\t' -t
  667. }
  668. fn_info_message_ballisticoverkill(){
  669. echo -e "netstat -atunp | grep BODS.x86"
  670. echo -e ""
  671. {
  672. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  673. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  674. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  675. } | column -s $'\t' -t
  676. }
  677. fn_info_message_battalion1944(){
  678. echo -e "netstat -atunp | grep BattalionServ"
  679. echo -e ""
  680. {
  681. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  682. echo -e "> Game\tINBOUND\t${port}\tudp"
  683. # Don't do arithmetics if ever the port wasn't a numeric value
  684. # unconfirmed - http://wiki.battaliongame.com/Community_Servers#Firewalls_.2F_Port_Forwarding
  685. if [ "${port}" -eq "${port}" ]; then
  686. echo -e "> Steam\tINBOUND\t$((port+1))\tudp"
  687. echo -e "> Unused\tINBOUND\t$((port+2))\ttcp"
  688. fi
  689. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  690. } | column -s $'\t' -t
  691. }
  692. fn_info_message_cod(){
  693. echo -e "netstat -atunp | grep cod_lnxded"
  694. echo -e ""
  695. {
  696. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  697. echo -e "> Game\tINBOUND\t${port}\tudp"
  698. } | column -s $'\t' -t
  699. }
  700. fn_info_message_coduo(){
  701. echo -e "netstat -atunp | grep coduo_lnxded"
  702. echo -e ""
  703. {
  704. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  705. echo -e "> Game\tINBOUND\t${port}\tudp"
  706. } | column -s $'\t' -t
  707. }
  708. fn_info_message_chivalry(){
  709. fn_info_message_password_strip
  710. echo -e "netstat -atunp | grep UDKGame"
  711. echo -e ""
  712. {
  713. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  714. echo -e "> Game\tINBOUND\t${port}\tudp"
  715. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  716. echo -e "> RCON\tINBOUND\t27960\ttcp"
  717. } | column -s $'\t' -t
  718. }
  719. fn_info_message_cod2(){
  720. echo -e "netstat -atunp | grep cod2_lnxded"
  721. echo -e ""
  722. {
  723. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  724. echo -e "> Game\tINBOUND\t${port}\tudp"
  725. } | column -s $'\t' -t
  726. }
  727. fn_info_message_cod4(){
  728. echo -e "netstat -atunp"
  729. echo -e ""
  730. {
  731. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  732. echo -e "> Game\tINBOUND\t${port}\tudp"
  733. } | column -s $'\t' -t
  734. }
  735. fn_info_message_codwaw(){
  736. echo -e "netstat -atunp | grep codwaw_lnxded"
  737. echo -e ""
  738. {
  739. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  740. echo -e "> Game\tINBOUND\t${port}\tudp"
  741. } | column -s $'\t' -t
  742. }
  743. fn_info_message_dst(){
  744. echo -e "netstat -atunp | grep dontstarve"
  745. echo -e ""
  746. {
  747. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  748. echo -e "> Game: Server\tINBOUND\t${port}\tudp"
  749. echo -e "> Game: Master\tINBOUND\t${masterport}\tudp"
  750. echo -e "> Steam: Auth\tINBOUND\t${steamauthenticationport}\tudp"
  751. echo -e "> Steam: Master\tINBOUND\t${steammasterserverport}\tudp"
  752. } | column -s $'\t' -t
  753. }
  754. fn_info_message_eco(){
  755. echo -e "netstat -atunp | grep EcoServer"
  756. echo -e ""
  757. {
  758. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  759. echo -e "> Game\tINBOUND\t${port}\tudp"
  760. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp"
  761. } | column -s $'\t' -t
  762. }
  763. fn_info_message_etlegacy(){
  764. echo -e "netstat -atunp | grep etlded"
  765. echo -e ""
  766. {
  767. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  768. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  769. } | column -s $'\t' -t
  770. }
  771. fn_info_message_factorio(){
  772. echo -e "netstat -atunp | grep factorio"
  773. echo -e ""
  774. {
  775. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  776. echo -e "> Game\tINBOUND\t${port}\tudp"
  777. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  778. } | column -s $'\t' -t
  779. }
  780. fn_info_message_goldsrc(){
  781. echo -e "netstat -atunp | grep hlds_linux"
  782. echo -e ""
  783. {
  784. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  785. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  786. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  787. } | column -s $'\t' -t
  788. }
  789. fn_info_message_hurtworld(){
  790. echo -e "netstat -atunp | grep Hurtworld"
  791. echo -e ""
  792. {
  793. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  794. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  795. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  796. } | column -s $'\t' -t
  797. }
  798. fn_info_message_inss(){
  799. echo -e "netstat -atunp | grep Insurgency"
  800. echo -e ""
  801. {
  802. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  803. echo -e "> Game\tINBOUND\t${port}\tudp"
  804. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  805. if [ -n "${rconport}" ]; then
  806. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  807. fi
  808. } | column -s $'\t' -t
  809. }
  810. fn_info_message_jk2(){
  811. echo -e "netstat -atunp | grep jk2mvded"
  812. echo -e ""
  813. {
  814. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  815. echo -e "> Game\tINBOUND\t${port}\tudp"
  816. } | column -s $'\t' -t
  817. }
  818. fn_info_message_justcause2(){
  819. echo -e "netstat -atunp | grep Jcmp-Server"
  820. echo -e ""
  821. {
  822. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  823. echo -e "> Game\tINBOUND\t${port}\tudp"
  824. } | column -s $'\t' -t
  825. }
  826. fn_info_message_justcause3(){
  827. echo -e "netstat -atunp | grep Server"
  828. echo -e ""
  829. {
  830. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  831. echo -e "> Game\tINBOUND\t${port}\tudp"
  832. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  833. echo -e "> Steam\tINBOUND\t${steamport}\tudp"
  834. } | column -s $'\t' -t
  835. }
  836. fn_info_message_minecraft(){
  837. echo -e "netstat -atunp | grep java"
  838. echo -e ""
  839. {
  840. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  841. echo -e "> Game\tINBOUND\t${port}\ttcp"
  842. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  843. echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
  844. } | column -s $'\t' -t
  845. }
  846. fn_info_message_minecraft_bedrock(){
  847. echo -e "netstat -atunp | grep bedrock_serv"
  848. echo -e ""
  849. {
  850. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  851. echo -e "> Game\tINBOUND\t${port}\tudp"
  852. echo -e "> Game\tINBOUND\t${port6}\tudp6"
  853. } | column -s $'\t' -t
  854. }
  855. fn_info_message_onset(){
  856. echo -e "netstat -atunp | grep OnsetServer"
  857. echo -e ""
  858. {
  859. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  860. echo -e "> Game\tINBOUND\t${port}\tudp"
  861. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  862. echo -e "> HTTP\tINBOUND\t${httpport}\ttcp"
  863. } | column -s $'\t' -t
  864. }
  865. fn_info_message_mohaa(){
  866. echo -e "netstat -atunp | grep mohaa_lnxded"
  867. echo -e ""
  868. {
  869. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  870. echo -e "> Game\tINBOUND\t${port}\tudp"
  871. } | column -s $'\t' -t
  872. }
  873. fn_info_message_mom(){
  874. echo -e "netstat -atunp | grep MemoriesOfMar"
  875. echo -e ""
  876. {
  877. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  878. echo -e "> Game\tINBOUND\t${port}\tudp"
  879. echo -e "> BeaconPort\tINBOUND\t${beaconport}\tudp"
  880. } | column -s $'\t' -t
  881. }
  882. fn_info_message_mumble(){
  883. echo -e "netstat -atunp | grep murmur"
  884. echo -e ""
  885. {
  886. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  887. echo -e "> Voice\tINBOUND\t${port}\tudp"
  888. echo -e "> ServerQuery\tINBOUND\t${port}\ttcp"
  889. } | column -s $'\t' -t
  890. }
  891. fn_info_message_pstbs(){
  892. echo -e "netstat -atunp | grep PostScriptum"
  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 "> RCON\tINBOUND\t${rconport}\ttcp"
  899. } | column -s $'\t' -t
  900. }
  901. fn_info_message_projectcars(){
  902. echo -e "netstat -atunp | grep DedicatedS"
  903. echo -e ""
  904. {
  905. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  906. echo -e "> Game\tINBOUND\t${port}\tudp"
  907. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  908. echo -e "> Steam\tINBOUND\t${steamport}\tudp"
  909. } | column -s $'\t' -t
  910. }
  911. fn_info_message_projectzomboid(){
  912. echo -e "netstat -atunp | grep ProjectZomb"
  913. echo -e ""
  914. {
  915. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  916. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  917. } | column -s $'\t' -t
  918. }
  919. fn_info_message_quake(){
  920. echo -e "netstat -atunp | grep mvdsv"
  921. echo -e ""
  922. {
  923. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  924. echo -e "> Game\tINBOUND\t${port}\tudp"
  925. } | column -s $'\t' -t
  926. }
  927. fn_info_message_quake2(){
  928. echo -e "netstat -atunp | grep quake2"
  929. echo -e ""
  930. {
  931. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  932. echo -e "> Game\tINBOUND\t${port}\tudp"
  933. } | column -s $'\t' -t
  934. }
  935. fn_info_message_quake3(){
  936. echo -e "netstat -atunp | grep q3ded"
  937. echo -e ""
  938. {
  939. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  940. echo -e "> Game\tINBOUND\t${port}\tudp"
  941. } | column -s $'\t' -t
  942. }
  943. fn_info_message_quakelive(){
  944. echo -e "netstat -atunp | grep qzeroded"
  945. echo -e ""
  946. if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then
  947. echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}."
  948. echo -e ""
  949. fi
  950. {
  951. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  952. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  953. echo -e "> Rcon\tINBOUND\t${rconport}\tudp"
  954. echo -e "> Stats\tINBOUND\t${statsport}\tudp"
  955. } | column -s $'\t' -t
  956. }
  957. fn_info_message_arma3(){
  958. echo -e "netstat -atunp | grep arma3server"
  959. echo -e ""
  960. # Default port
  961. if [ -z "${port}" ]; then
  962. port="2302"
  963. fi
  964. {
  965. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  966. echo -e "> Game\tINBOUND\t${port}\tudp"
  967. # Don't do arithmetics if ever the port wasn't a numeric value
  968. if [ "${port}" -eq "${port}" ]; then
  969. echo -e "> Query Steam\tINBOUND\t$((port+1))\tudp"
  970. echo -e "> Steam: Master traffic\tINBOUND\t$((port+2))\tudp"
  971. echo -e "> Undocumented Port\tINBOUND\t$((port+3))\tudp"
  972. fi
  973. } | column -s $'\t' -t
  974. }
  975. fn_info_message_bf1942(){
  976. echo -e "netstat -atunp | grep bf1942_lnxd"
  977. echo -e ""
  978. {
  979. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  980. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  981. echo -e "> Query Steam\tINBOUND\t${queryport}\tudp"
  982. } | column -s $'\t' -t
  983. }
  984. fn_info_message_bfv(){
  985. echo -e "netstat -atunp | grep bfv_linded"
  986. echo -e ""
  987. {
  988. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  989. echo -e "> Game\tINBOUND\t${port}\tudp"
  990. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  991. } | column -s $'\t' -t
  992. }
  993. fn_info_message_risingworld(){
  994. echo -e "netstat -atunp | grep java"
  995. echo -e ""
  996. {
  997. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  998. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  999. echo -e "> Query HTTP\tINBOUND\t${httpqueryport}\ttcp"
  1000. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  1001. } | column -s $'\t' -t
  1002. }
  1003. fn_info_message_rtcw(){
  1004. echo -e "netstat -atunp | grep iowolfded"
  1005. echo -e ""
  1006. {
  1007. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1008. echo -e "> Game\tINBOUND\t${port}\tudp"
  1009. } | column -s $'\t' -t
  1010. }
  1011. fn_info_message_rust(){
  1012. echo -e "netstat -atunp | grep Rust"
  1013. echo -e ""
  1014. {
  1015. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1016. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  1017. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  1018. } | column -s $'\t' -t
  1019. }
  1020. fn_info_message_samp(){
  1021. echo -e "netstat -atunp | grep samp03svr"
  1022. echo -e ""
  1023. {
  1024. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1025. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  1026. } | column -s $'\t' -t
  1027. }
  1028. fn_info_message_sbots(){
  1029. echo -e "netstat -atunp | grep blank1"
  1030. echo -e ""
  1031. {
  1032. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1033. echo -e "> Game\tINBOUND\t${port}\tudp"
  1034. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1035. } | column -s $'\t' -t
  1036. }
  1037. fn_info_message_sdtd(){
  1038. fn_info_message_password_strip
  1039. echo -e "netstat -atunp | grep 7DaysToDie"
  1040. echo -e ""
  1041. {
  1042. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1043. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  1044. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1045. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp"
  1046. echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
  1047. } | column -s $'\t' -t
  1048. echo -e ""
  1049. echo -e "${lightgreen}${gamename} Web Admin${default}"
  1050. fn_messages_separator
  1051. {
  1052. echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
  1053. echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
  1054. echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
  1055. } | column -s $'\t' -t
  1056. echo -e ""
  1057. echo -e "${lightgreen}${gamename} Telnet${default}"
  1058. fn_messages_separator
  1059. {
  1060. echo -e "${lightblue}Telnet enabled:\t${default}${telnetenabled}"
  1061. echo -e "${lightblue}Telnet address:\t${default}${telnetip} ${telnetport}"
  1062. echo -e "${lightblue}Telnet password:\t${default}${telnetpass}"
  1063. } | column -s $'\t' -t
  1064. }
  1065. fn_info_message_sof2(){
  1066. echo -e "netstat -atunp | grep sof2ded"
  1067. echo -e ""
  1068. {
  1069. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1070. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  1071. } | column -s $'\t' -t
  1072. }
  1073. fn_info_message_source(){
  1074. echo -e "netstat -atunp | grep srcds_linux"
  1075. echo -e ""
  1076. {
  1077. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1078. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  1079. echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp"
  1080. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  1081. } | column -s $'\t' -t
  1082. }
  1083. fn_info_message_spark(){
  1084. fn_info_message_password_strip
  1085. echo -e "netstat -atunp | grep server_linux"
  1086. echo -e ""
  1087. {
  1088. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1089. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  1090. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1091. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp"
  1092. } | column -s $'\t' -t
  1093. echo -e ""
  1094. echo -e "${lightgreen}${servername} Web Admin${default}"
  1095. fn_messages_separator
  1096. {
  1097. echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}/index.html"
  1098. echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
  1099. echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
  1100. } | column -s $'\t' -t
  1101. }
  1102. fn_info_message_squad(){
  1103. echo -e "netstat -atunp | grep SquadServer"
  1104. echo -e ""
  1105. {
  1106. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1107. echo -e "> Game\tINBOUND\t${port}\tudp"
  1108. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1109. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  1110. } | column -s $'\t' -t
  1111. }
  1112. fn_info_message_starbound(){
  1113. echo -e "netstat -atunp | grep starbound"
  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. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  1120. } | column -s $'\t' -t
  1121. }
  1122. fn_info_message_stationeers(){
  1123. echo -e "netstat -atunp | grep rocketstation"
  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. } | column -s $'\t' -t
  1130. }
  1131. fn_info_message_teamspeak3(){
  1132. echo -e "netstat -atunp | grep ts3server"
  1133. echo -e ""
  1134. {
  1135. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1136. echo -e "> Voice\tINBOUND\t${port}\tudp"
  1137. echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp"
  1138. echo -e "> File transfer\tINBOUND\t${fileport}\ttcp"
  1139. } | column -s $'\t' -t
  1140. }
  1141. fn_info_message_teeworlds(){
  1142. echo -e "netstat -atunp | grep teeworlds"
  1143. echo -e ""
  1144. {
  1145. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1146. echo -e "> Game\Query\tINBOUND\t${port}\ttcp"
  1147. } | column -s $'\t' -t
  1148. }
  1149. fn_info_message_terraria(){
  1150. echo -e "netstat -atunp | grep Terraria"
  1151. echo -e ""
  1152. {
  1153. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1154. echo -e "> Game\tINBOUND\t${port}\ttcp"
  1155. } | column -s $'\t' -t
  1156. }
  1157. fn_info_message_towerunite(){
  1158. echo -e "netstat -atunp | grep TowerServer"
  1159. echo -e ""
  1160. {
  1161. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1162. echo -e "> Game\tINBOUND\t${port}\ttcp"
  1163. # Don't do arithmetics if ever the port wasn't a numeric value
  1164. if [ "${port}" -eq "${port}" ]; then
  1165. echo -e "> Steam\tINBOUND\t$((port+1))\tudp"
  1166. fi
  1167. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1168. } | column -s $'\t' -t
  1169. }
  1170. fn_info_message_unreal(){
  1171. fn_info_message_password_strip
  1172. echo -e "netstat -atunp | grep ucc-bin"
  1173. echo -e ""
  1174. {
  1175. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  1176. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  1177. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1178. if [ "${engine}" == "unreal" ]; then
  1179. echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp"
  1180. fi
  1181. if [ "${engine}" != "unreal" ]&&[ "${appid}" != "223250" ]; then
  1182. echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}"
  1183. fi
  1184. if [ "${appid}" == "215360" ]; then
  1185. echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp"
  1186. else
  1187. echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp"
  1188. fi
  1189. if [ "${appid}" ]; then
  1190. if [ "${appid}" == "223250" ]; then
  1191. echo -e "> Steam\tINBOUND\t20610\tudp"
  1192. else
  1193. echo -e "> Steam\tINBOUND\t20660\tudp"
  1194. fi
  1195. fi
  1196. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  1197. } | column -s $'\t' -t
  1198. echo -e ""
  1199. echo -e "${lightgreen}${servername} Web Admin${default}"
  1200. fn_messages_separator
  1201. {
  1202. echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
  1203. echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
  1204. echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
  1205. echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
  1206. } | column -s $'\t' -t
  1207. }
  1208. fn_info_message_unreal2(){
  1209. fn_info_message_password_strip
  1210. echo -e "netstat -atunp | grep ucc-bin"
  1211. echo -e ""
  1212. {
  1213. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  1214. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  1215. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1216. if [ "${appid}" != "223250" ]; then
  1217. echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}"
  1218. fi
  1219. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  1220. } | column -s $'\t' -t
  1221. echo -e ""
  1222. echo -e "${lightgreen}${servername} Web Admin${default}"
  1223. fn_messages_separator
  1224. {
  1225. echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
  1226. echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
  1227. echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
  1228. echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
  1229. } | column -s $'\t' -t
  1230. }
  1231. fn_info_message_unreal3(){
  1232. fn_info_message_password_strip
  1233. echo -e "netstat -atunp | grep ut3-bin"
  1234. echo -e ""
  1235. {
  1236. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1237. echo -e "> Game\tINBOUND\t${port}\tudp"
  1238. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1239. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  1240. } | column -s $'\t' -t
  1241. echo -e ""
  1242. echo -e "${lightgreen}${servername} Web Admin${default}"
  1243. fn_messages_separator
  1244. {
  1245. echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
  1246. echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
  1247. echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
  1248. echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
  1249. } | column -s $'\t' -t
  1250. }
  1251. fn_info_message_unturned(){
  1252. echo -e "netstat -atunp | grep Unturned"
  1253. echo -e ""
  1254. {
  1255. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1256. echo -e "> Game\tINBOUND\t${port}\tudp"
  1257. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1258. } | column -s $'\t' -t
  1259. }
  1260. fn_info_message_ut(){
  1261. echo -e "netstat -atunp | grep UE4Server"
  1262. echo -e ""
  1263. {
  1264. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1265. echo -e "> Game\tINBOUND\t${port}\tudp"
  1266. } | column -s $'\t' -t
  1267. }
  1268. fn_info_message_vh(){
  1269. echo -e "netstat -atunp | grep valheim"
  1270. echo -e ""
  1271. {
  1272. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1273. echo -e "> Game\tINBOUND\t${port}\tudp"
  1274. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1275. } | column -s $'\t' -t
  1276. }
  1277. fn_info_message_kf2(){
  1278. fn_info_message_password_strip
  1279. echo -e "netstat -atunp | grep KFGame"
  1280. echo -e ""
  1281. {
  1282. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1283. echo -e "> Game\tINBOUND\t${port}\ttcp\tPort=${port}"
  1284. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1285. echo -e "> Steam\tINBOUND\t20560\tudp"
  1286. echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  1287. } | column -s $'\t' -t
  1288. echo -e ""
  1289. echo -e "${lightgreen}${servername} Web Admin${default}"
  1290. fn_messages_separator
  1291. {
  1292. echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}"
  1293. echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}"
  1294. echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}"
  1295. echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}"
  1296. } | column -s $'\t' -t
  1297. }
  1298. fn_info_message_wolfensteinenemyterritory(){
  1299. echo -e "netstat -atunp | grep etded"
  1300. echo -e ""
  1301. {
  1302. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1303. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  1304. } | column -s $'\t' -t
  1305. }
  1306. fn_info_message_wurmunlimited(){
  1307. echo -e "netstat -atunp | grep WurmServer"
  1308. echo -e ""
  1309. {
  1310. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1311. echo -e "> Game\tINBOUND\t${port}\ttcp"
  1312. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1313. } | column -s $'\t' -t
  1314. }
  1315. fn_info_message_mta(){
  1316. echo -e "netstat -atunp | grep mta-server"
  1317. echo -e ""
  1318. {
  1319. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1320. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  1321. echo -e "> HTTP Server\tINBOUND\t${httpport}\ttcp"
  1322. if [ "${ase}" == "Enabled" ]; then
  1323. echo -e "> Query Port\tOUTBOUND\t${queryport}\tudp"
  1324. fi
  1325. } | column -s $'\t' -t
  1326. }
  1327. fn_info_message_mordhau(){
  1328. echo -e "netstat -atunp | grep Mord"
  1329. echo -e ""
  1330. {
  1331. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1332. echo -e "> Game\tINBOUND\t${port}\tudp"
  1333. echo -e "> BeaconPort\tINBOUND\t${beaconport}\tudp"
  1334. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1335. } | column -s $'\t' -t
  1336. }
  1337. fn_info_message_barotrauma(){
  1338. echo -e "netstat -atunp | grep /./Server.bin"
  1339. echo -e ""
  1340. {
  1341. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1342. echo -e "> Game\tINBOUND\t${port}\tudp"
  1343. echo -e "> Query\tINBOUND\t$((port+1))\tudp"
  1344. } | column -s $'\t' -t
  1345. }
  1346. fn_info_message_soldat() {
  1347. echo -e "netstat -atunp | grep soldat"
  1348. echo -e ""
  1349. {
  1350. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1351. echo -e "> Game\tINBOUND\t${port}\tudp"
  1352. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1353. echo -e "> FILES\tINBOUND\t$((port+10))\ttcp"
  1354. } | column -s $'\t' -t
  1355. }
  1356. fn_info_message_warfork(){
  1357. echo -e "netstat -atunp | grep wf_server"
  1358. echo -e ""
  1359. {
  1360. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1361. echo -e "> Game\tINBOUND\t${port}\tudp"
  1362. echo -e "> HTTP\tINBOUND\t${httpport}\ttcp"
  1363. } | column -s $'\t' -t
  1364. }
  1365. fn_info_message_pavlovvr(){
  1366. echo "netstat -atunp | grep Pavlov"
  1367. echo -e ""
  1368. {
  1369. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  1370. echo -e "> Game\tINBOUND\t${port}\tudp"
  1371. echo -e "> Game\tINBOUND\t$((port+400))\tudp"
  1372. } | column -s $'\t' -t
  1373. }
  1374. fn_info_message_colony(){
  1375. echo -e "netstat -atunp | grep colonyserv"
  1376. echo -e ""
  1377. {
  1378. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1379. echo -e "> Game\tINBOUND\t${port}\tudp"
  1380. echo -e "> Steam\tINBOUND\t${steamport}\tudp"
  1381. } | column -s $'\t' -t
  1382. }
  1383. fn_info_message_vintagestory(){
  1384. echo "netstat -atunp | grep cli"
  1385. echo -e ""
  1386. {
  1387. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  1388. echo -e "> Game\tINBOUND\t${port}\tTCP"
  1389. } | column -s $'\t' -t
  1390. }
  1391. fn_info_message_scpsl(){
  1392. echo -e "netstat -atunp | grep SCPSL"
  1393. echo -e ""
  1394. {
  1395. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1396. echo -e "> Game\tINBOUND\t${port}\tudp"
  1397. } | column -s $'\t' -t
  1398. }
  1399. fn_info_message_select_engine(){
  1400. # Display details depending on game or engine.
  1401. if [ "${shortname}" == "ac" ]; then
  1402. fn_info_message_assettocorsa
  1403. elif [ "${shortname}" == "ark" ]; then
  1404. fn_info_message_ark
  1405. elif [ "${shortname}" == "av" ]; then
  1406. fn_info_message_avorion
  1407. elif [ "${shortname}" == "arma3" ]; then
  1408. fn_info_message_arma3
  1409. elif [ "${shortname}" == "bf1942" ]; then
  1410. fn_info_message_bf1942
  1411. elif [ "${shortname}" == "bfv" ]; then
  1412. fn_info_message_bfv
  1413. elif [ "${shortname}" == "bo" ]; then
  1414. fn_info_message_ballisticoverkill
  1415. elif [ "${shortname}" == "bt" ]; then
  1416. fn_info_message_barotrauma
  1417. elif [ "${shortname}" == "bt1944" ]; then
  1418. fn_info_message_battalion1944
  1419. elif [ "${shortname}" == "cmw" ]; then
  1420. fn_info_message_chivalry
  1421. elif [ "${shortname}" == "cod" ]; then
  1422. fn_info_message_cod
  1423. elif [ "${shortname}" == "coduo" ]; then
  1424. fn_info_message_coduo
  1425. elif [ "${shortname}" == "cod2" ]; then
  1426. fn_info_message_cod2
  1427. elif [ "${shortname}" == "cod4" ]; then
  1428. fn_info_message_cod4
  1429. elif [ "${shortname}" == "codwaw" ]; then
  1430. fn_info_message_codwaw
  1431. elif [ "${shortname}" == "col" ]; then
  1432. fn_info_message_colony
  1433. elif [ "${shortname}" == "dst" ]; then
  1434. fn_info_message_dst
  1435. elif [ "${shortname}" == "eco" ]; then
  1436. fn_info_message_eco
  1437. elif [ "${shortname}" == "etl" ]; then
  1438. fn_info_message_etlegacy
  1439. elif [ "${shortname}" == "fctr" ]; then
  1440. fn_info_message_factorio
  1441. elif [ "${shortname}" == "hw" ]; then
  1442. fn_info_message_hurtworld
  1443. elif [ "${shortname}" == "inss" ]; then
  1444. fn_info_message_inss
  1445. elif [ "${shortname}" == "jk2" ]; then
  1446. fn_info_message_jk2
  1447. elif [ "${shortname}" == "jc2" ]; then
  1448. fn_info_message_justcause2
  1449. elif [ "${shortname}" == "jc3" ]; then
  1450. fn_info_message_justcause3
  1451. elif [ "${shortname}" == "kf2" ]; then
  1452. fn_info_message_kf2
  1453. elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]; then
  1454. fn_info_message_minecraft
  1455. elif [ "${shortname}" == "mcb" ]; then
  1456. fn_info_message_minecraft_bedrock
  1457. elif [ "${shortname}" == "mh" ]; then
  1458. fn_info_message_mordhau
  1459. elif [ "${shortname}" == "mohaa" ]; then
  1460. fn_info_message_mohaa
  1461. elif [ "${shortname}" == "mta" ]; then
  1462. fn_info_message_mta
  1463. elif [ "${shortname}" == "mumble" ]; then
  1464. fn_info_message_mumble
  1465. elif [ "${shortname}" == "onset" ]; then
  1466. fn_info_message_onset
  1467. elif [ "${shortname}" == "mom" ]; then
  1468. fn_info_message_mom
  1469. elif [ "${shortname}" == "pz" ]; then
  1470. fn_info_message_projectzomboid
  1471. elif [ "${shortname}" == "pstbs" ]; then
  1472. fn_info_message_pstbs
  1473. elif [ "${shortname}" == "pc" ]; then
  1474. fn_info_message_projectcars
  1475. elif [ "${shortname}" == "qw" ]; then
  1476. fn_info_message_quake
  1477. elif [ "${shortname}" == "q2" ]; then
  1478. fn_info_message_quake2
  1479. elif [ "${shortname}" == "q3" ]; then
  1480. fn_info_message_quake3
  1481. elif [ "${shortname}" == "ql" ]; then
  1482. fn_info_message_quakelive
  1483. elif [ "${shortname}" == "samp" ]; then
  1484. fn_info_message_samp
  1485. elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then
  1486. fn_info_message_scpsl
  1487. elif [ "${shortname}" == "sdtd" ]; then
  1488. fn_info_message_sdtd
  1489. elif [ "${shortname}" == "squad" ]; then
  1490. fn_info_message_squad
  1491. elif [ "${shortname}" == "st" ]; then
  1492. fn_info_message_stationeers
  1493. elif [ "${shortname}" == "sof2" ]; then
  1494. fn_info_message_sof2
  1495. elif [ "${shortname}" == "sol" ]; then
  1496. fn_info_message_soldat
  1497. elif [ "${shortname}" == "sb" ]; then
  1498. fn_info_message_starbound
  1499. elif [ "${shortname}" == "sbots" ]; then
  1500. fn_info_message_sbots
  1501. elif [ "${shortname}" == "terraria" ]; then
  1502. fn_info_message_terraria
  1503. elif [ "${shortname}" == "ts3" ]; then
  1504. fn_info_message_teamspeak3
  1505. elif [ "${shortname}" == "tu" ]; then
  1506. fn_info_message_towerunite
  1507. elif [ "${shortname}" == "tw" ]; then
  1508. fn_info_message_teeworlds
  1509. elif [ "${shortname}" == "unt" ]; then
  1510. fn_info_message_unturned
  1511. elif [ "${shortname}" == "ut" ]; then
  1512. fn_info_message_ut
  1513. elif [ "${shortname}" == "vh" ]; then
  1514. fn_info_message_vh
  1515. elif [ "${shortname}" == "rtcw" ]; then
  1516. fn_info_message_rtcw
  1517. elif [ "${shortname}" == "pvr" ]; then
  1518. fn_info_message_pavlovvr
  1519. elif [ "${shortname}" == "rust" ]; then
  1520. fn_info_message_rust
  1521. elif [ "${shortname}" == "vints" ]; then
  1522. fn_info_message_vintagestory
  1523. elif [ "${shortname}" == "wf" ]; then
  1524. fn_info_message_warfork
  1525. elif [ "${shortname}" == "wurm" ]; then
  1526. fn_info_message_wurmunlimited
  1527. elif [ "${shortname}" == "rw" ]; then
  1528. fn_info_message_risingworld
  1529. elif [ "${shortname}" == "wet" ]; then
  1530. fn_info_message_wolfensteinenemyterritory
  1531. elif [ "${engine}" == "goldsrc" ]; then
  1532. fn_info_message_goldsrc
  1533. elif [ "${engine}" == "source" ]; then
  1534. fn_info_message_source
  1535. elif [ "${engine}" == "spark" ]; then
  1536. fn_info_message_spark
  1537. elif [ "${engine}" == "unreal" ]; then
  1538. fn_info_message_unreal
  1539. elif [ "${engine}" == "unreal2" ]; then
  1540. fn_info_message_unreal2
  1541. elif [ "${engine}" == "unreal3" ]; then
  1542. fn_info_message_unreal3
  1543. else
  1544. fn_print_error_nl "Unable to detect server engine."
  1545. fi
  1546. }