info_messages.sh 48 KB

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