info_messages.sh 50 KB

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