info_messages.sh 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632
  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. # authentication token (Factorio)
  339. if [ -n "${authtoken}" ]; then
  340. echo -e "${lightblue}Auth Token:\t${default}${authtoken}"
  341. fi
  342. # savegameinterval (Factorio)
  343. if [ -n "${savegameinterval}" ]; then
  344. echo -e "${lightblue}Savegame Interval:\t${default}${savegameinterval}"
  345. fi
  346. # versioncount (Factorio)
  347. if [ -n "${versioncount}" ]; then
  348. echo -e "${lightblue}Version Count:\t${default}${versioncount}"
  349. fi
  350. # Listed on Master server
  351. if [ -n "${displaymasterserver}" ]; then
  352. if [ "${displaymasterserver}" == "true" ]; then
  353. echo -e "${lightblue}Master server:\t${green}listed${default}"
  354. else
  355. echo -e "${lightblue}Master server:\t${red}not listed${default}"
  356. fi
  357. fi
  358. # Online status
  359. if [ "${status}" == "0" ]; then
  360. echo -e "${lightblue}Status:\t${red}OFFLINE${default}"
  361. else
  362. echo -e "${lightblue}Status:\t${green}ONLINE${default}"
  363. fi
  364. } | column -s $'\t' -t
  365. echo -e ""
  366. }
  367. fn_info_message_script(){
  368. #
  369. # csgoserver Script Details
  370. #==========================================================================================================================================================================================================================================
  371. # Script name: csgoserver
  372. # LinuxGSM version: v19.9.0
  373. # glibc required: 2.15
  374. # Discord alert: off
  375. # Slack alert: off
  376. # Email alert: off
  377. # Pushbullet alert: off
  378. # IFTTT alert: off
  379. # Mailgun (email) alert: off
  380. # Pushover alert: off
  381. # Telegram alert: off
  382. # Update on start: off
  383. # User: lgsm
  384. # Location: /home/lgsm/csgoserver
  385. # Config file: /home/lgsm/csgoserver/serverfiles/csgo/cfg/csgoserver.cfg
  386. echo -e "${lightgreen}${selfname} Script Details${default}"
  387. fn_messages_separator
  388. {
  389. # Script name
  390. echo -e "${lightblue}Script name:\t${default}${selfname}"
  391. # LinuxGSM version
  392. if [ -n "${version}" ]; then
  393. echo -e "${lightblue}LinuxGSM version:\t${default}${version}"
  394. fi
  395. # glibc required
  396. if [ -n "${glibc}" ]; then
  397. if [ "${glibc}" == "null" ]; then
  398. # Glibc is not required.
  399. :
  400. elif [ -z "${glibc}" ]; then
  401. echo -e "${lightblue}glibc required:\t${red}UNKNOWN${default}"
  402. elif [ "$(printf '%s\n'${glibc}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibc}" ]; then
  403. echo -e "${lightblue}glibc required:\t${red}${glibc} ${default}(${red}distro glibc ${glibcversion} too old${default})"
  404. else
  405. echo -e "${lightblue}glibc required:\t${green}${glibc}${default}"
  406. fi
  407. fi
  408. # Discord alert
  409. echo -e "${lightblue}Discord alert:\t${default}${discordalert}"
  410. # Slack alert
  411. echo -e "${lightblue}Slack alert:\t${default}${slackalert}"
  412. # Email alert
  413. echo -e "${lightblue}Email alert:\t${default}${emailalert}"
  414. # Pushbullet alert
  415. echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}"
  416. # IFTTT alert
  417. echo -e "${lightblue}IFTTT alert:\t${default}${iftttalert}"
  418. # Mailgun alert
  419. echo -e "${lightblue}Mailgun (email) alert:\t${default}${mailgunalert}"
  420. # Pushover alert
  421. echo -e "${lightblue}Pushover alert:\t${default}${pushoveralert}"
  422. # Telegram alert
  423. echo -e "${lightblue}Telegram alert:\t${default}${telegramalert}"
  424. # Update on start
  425. if [ -n "${updateonstart}" ]; then
  426. echo -e "${lightblue}Update on start:\t${default}${updateonstart}"
  427. fi
  428. # User
  429. echo -e "${lightblue}User:\t${default}$(whoami)"
  430. # Script location
  431. echo -e "${lightblue}Location:\t${default}${rootdir}"
  432. # Config file location
  433. if [ -n "${servercfgfullpath}" ]; then
  434. if [ -f "${servercfgfullpath}" ]; then
  435. echo -e "${lightblue}Config file:\t${default}${servercfgfullpath}"
  436. elif [ -d "${servercfgfullpath}" ]; then
  437. echo -e "${lightblue}Config dir:\t${default}${servercfgfullpath}"
  438. else
  439. echo -e "${lightblue}Config file:\t${default}${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})"
  440. fi
  441. fi
  442. # Network config file location (ARMA 3)
  443. if [ -n "${networkcfgfullpath}" ]; then
  444. echo -e "${lightblue}Network config file:\t${default}${networkcfgfullpath}"
  445. fi
  446. } | column -s $'\t' -t
  447. }
  448. fn_info_message_backup(){
  449. #
  450. # Backups
  451. # =====================================
  452. # No. of backups: 1
  453. # Latest backup:
  454. # date: Fri May 6 18:34:19 UTC 2016
  455. # file: /home/lgsm/qlserver/backups/ql-server-2016-05-06-183239.tar.gz
  456. # size: 945M
  457. echo -e ""
  458. echo -e "${lightgreen}Backups${default}"
  459. fn_messages_separator
  460. if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
  461. echo -e "No Backups created"
  462. else
  463. {
  464. echo -e "${lightblue}No. of backups:\t${default}${backupcount}"
  465. echo -e "${lightblue}Latest backup:${default}"
  466. if [ "${lastbackupdaysago}" == "0" ]; then
  467. echo -e "${lightblue} date:\t${default}${lastbackupdate} (less than 1 day ago)"
  468. elif [ "${lastbackupdaysago}" == "1" ]; then
  469. echo -e "${lightblue} date:\t${default}${lastbackupdate} (1 day ago)"
  470. else
  471. echo -e "${lightblue} date:\t${default}${lastbackupdate} (${lastbackupdaysago} days ago)"
  472. fi
  473. echo -e "${lightblue} file:\t${default}${lastbackup}"
  474. echo -e "${lightblue} size:\t${default}${lastbackupsize}"
  475. } | column -s $'\t' -t
  476. fi
  477. }
  478. fn_info_message_commandlineparms(){
  479. #
  480. # Command-line Parameters
  481. # =====================================
  482. # ./run_server_x86.sh +set net_strict 1
  483. echo -e ""
  484. echo -e "${lightgreen}Command-line Parameters${default}"
  485. fn_info_message_password_strip
  486. fn_messages_separator
  487. if [ "${serverpassword}" == "NOT SET" ]; then
  488. unset serverpassword
  489. fi
  490. fn_parms
  491. echo -e "${executable} ${parms}"
  492. }
  493. fn_info_message_ports(){
  494. # Ports
  495. # =====================================
  496. # Change ports by editing the parameters in:
  497. # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg
  498. echo -e ""
  499. echo -e "${lightgreen}Ports${default}"
  500. fn_messages_separator
  501. echo -e "${lightblue}Change ports by editing the parameters in:${default}"
  502. parmslocation="${red}UNKNOWN${default}"
  503. # engines/games that require editing in the config file.
  504. 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")
  505. for port_edit in "${ports_edit_array[@]}"; do
  506. if [ "${shortname}" == "ut3" ]; then
  507. parmslocation="${servercfgdir}/UTWeb.ini"
  508. elif [ "${shortname}" == "kf2" ]; then
  509. parmslocation="${servercfgdir}/LinuxServer-KFEngine.ini\n${servercfgdir}/KFWeb.ini"
  510. elif [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
  511. parmslocation="${servercfgfullpath}"
  512. fi
  513. done
  514. # engines/games that require editing the parms.
  515. local ports_edit_array=( "Avorion" "goldsrc" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "qfusion" "Rust" "Soldat" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned" )
  516. for port_edit in "${ports_edit_array[@]}"; do
  517. if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then
  518. parmslocation="${configdirserver}"
  519. fi
  520. done
  521. echo -e "${parmslocation}"
  522. echo -e ""
  523. echo -e "${lightblue}Useful port diagnostic command:${default}"
  524. }
  525. fn_info_message_statusbottom(){
  526. echo -e ""
  527. if [ "${status}" == "0" ]; then
  528. echo -e "${lightblue}Status:\t${red}OFFLINE${default}"
  529. else
  530. echo -e "${lightblue}Status:\t${green}ONLINE${default}"
  531. fi
  532. echo -e ""
  533. }
  534. fn_info_logs(){
  535. echo -e ""
  536. echo -e "${selfname} Logs"
  537. echo -e "================================="
  538. if [ -n "${lgsmlog}" ]; then
  539. echo -e "\nScript log\n==================="
  540. if [ ! "$(ls -A "${lgsmlogdir}")" ]; then
  541. echo -e "${lgsmlogdir} (NO LOG FILES)"
  542. elif [ ! -s "${lgsmlog}" ]; then
  543. echo -e "${lgsmlog} (LOG FILE IS EMPTY)"
  544. else
  545. echo -e "${lgsmlog}"
  546. tail -25 "${lgsmlog}"
  547. fi
  548. echo -e ""
  549. fi
  550. if [ -n "${consolelog}" ]; then
  551. echo -e "\nConsole log\n===================="
  552. if [ ! "$(ls -A "${consolelogdir}")" ]; then
  553. echo -e "${consolelogdir} (NO LOG FILES)"
  554. elif [ ! -s "${consolelog}" ]; then
  555. echo -e "${consolelog} (LOG FILE IS EMPTY)"
  556. else
  557. echo -e "${consolelog}"
  558. tail -25 "${consolelog}" | awk '{ sub("\r$", ""); print }'
  559. fi
  560. echo -e ""
  561. fi
  562. if [ -n "${gamelogdir}" ]; then
  563. echo -e "\nServer log\n==================="
  564. if [ ! "$(ls -A "${gamelogdir}")" ]; then
  565. echo -e "${gamelogdir} (NO LOG FILES)"
  566. else
  567. echo -e "${gamelogdir}"
  568. # dos2unix sed 's/\r//'
  569. tail "${gamelogdir}"/* 2>/dev/null | grep -v "==>" | sed '/^$/d' | sed 's/\r//' | tail -25
  570. fi
  571. echo -e ""
  572. fi
  573. }
  574. # Engine/Game Specific details
  575. fn_info_message_assettocorsa(){
  576. echo -e "netstat -atunp| grep acServer"
  577. echo -e ""
  578. {
  579. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  580. echo -e "> Game\tINBOUND\t${port}\tudp"
  581. echo -e "> HTTP\tINBOUND\t${port}\tudp"
  582. } | column -s $'\t' -t
  583. }
  584. fn_info_message_ark(){
  585. echo -e "netstat -atunp | grep ShooterGame"
  586. echo -e ""
  587. {
  588. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  589. echo -e "> Game\tINBOUND\t${port}\tudp"
  590. # Don't do arithmetics if ever the port wasn't a numeric value
  591. if [ "${port}" -eq "${port}" ]; then
  592. echo -e "> RAW\tINBOUND\t$((port+1))\tudp"
  593. fi
  594. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  595. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  596. } | column -s $'\t' -t
  597. }
  598. fn_info_message_avorion() {
  599. echo "netstat -atunp | grep Avorion"
  600. echo -e ""
  601. {
  602. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  603. echo -e "> Game\tINBOUND\t${port}\tudp"
  604. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  605. } | column -s $'\t' -t
  606. }
  607. fn_info_message_ballisticoverkill(){
  608. echo -e "netstat -atunp | grep BODS.x86"
  609. echo -e ""
  610. {
  611. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  612. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  613. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  614. } | column -s $'\t' -t
  615. }
  616. fn_info_message_battalion1944(){
  617. echo -e "netstat -atunp | grep BattalionServ"
  618. echo -e ""
  619. {
  620. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  621. echo -e "> Game\tINBOUND\t${port}\tudp"
  622. # Don't do arithmetics if ever the port wasn't a numeric value
  623. # unconfirmed - http://wiki.battaliongame.com/Community_Servers#Firewalls_.2F_Port_Forwarding
  624. if [ "${port}" -eq "${port}" ]; then
  625. echo -e "> Steam\tINBOUND\t$((port+1))\tudp"
  626. echo -e "> Unused\tINBOUND\t$((port+2))\ttcp"
  627. fi
  628. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  629. } | column -s $'\t' -t
  630. }
  631. fn_info_message_cod(){
  632. echo -e "netstat -atunp | grep cod_lnxded"
  633. echo -e ""
  634. {
  635. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  636. echo -e "> Game\tINBOUND\t${port}\tudp"
  637. } | column -s $'\t' -t
  638. }
  639. fn_info_message_coduo(){
  640. echo -e "netstat -atunp | grep coduo_lnxded"
  641. echo -e ""
  642. {
  643. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  644. echo -e "> Game\tINBOUND\t${port}\tudp"
  645. } | column -s $'\t' -t
  646. }
  647. fn_info_message_chivalry(){
  648. fn_info_message_password_strip
  649. echo -e "netstat -atunp | grep UDKGame"
  650. echo -e ""
  651. {
  652. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  653. echo -e "> Game\tINBOUND\t${port}\tudp"
  654. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  655. echo -e "> RCON\tINBOUND\t27960\ttcp"
  656. } | column -s $'\t' -t
  657. }
  658. fn_info_message_cod2(){
  659. echo -e "netstat -atunp | grep cod2_lnxded"
  660. echo -e ""
  661. {
  662. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  663. echo -e "> Game\tINBOUND\t${port}\tudp"
  664. } | column -s $'\t' -t
  665. }
  666. fn_info_message_cod4(){
  667. echo -e "netstat -atunp"
  668. echo -e ""
  669. {
  670. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  671. echo -e "> Game\tINBOUND\t${port}\tudp"
  672. } | column -s $'\t' -t
  673. }
  674. fn_info_message_codwaw(){
  675. echo -e "netstat -atunp | grep codwaw_lnxded"
  676. echo -e ""
  677. {
  678. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  679. echo -e "> Game\tINBOUND\t${port}\tudp"
  680. } | column -s $'\t' -t
  681. }
  682. fn_info_message_dst(){
  683. echo -e "netstat -atunp | grep dontstarve"
  684. echo -e ""
  685. {
  686. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  687. echo -e "> Game: Server\tINBOUND\t${port}\tudp"
  688. echo -e "> Game: Master\tINBOUND\t${masterport}\tudp"
  689. echo -e "> Steam: Auth\tINBOUND\t${steamauthenticationport}\tudp"
  690. echo -e "> Steam: Master\tINBOUND\t${steammasterserverport}\tudp"
  691. } | column -s $'\t' -t
  692. }
  693. fn_info_message_eco(){
  694. echo -e "netstat -atunp | grep EcoServer"
  695. echo -e ""
  696. {
  697. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  698. echo -e "> Game\tINBOUND\t${port}\tudp"
  699. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  700. } | column -s $'\t' -t
  701. }
  702. fn_info_message_etlegacy(){
  703. echo -e "netstat -atunp | grep etlded"
  704. echo -e ""
  705. {
  706. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  707. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  708. } | column -s $'\t' -t
  709. }
  710. fn_info_message_factorio(){
  711. echo -e "netstat -atunp | grep factorio"
  712. echo -e ""
  713. {
  714. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  715. echo -e "> Game\tINBOUND\t${port}\tudp"
  716. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  717. } | column -s $'\t' -t
  718. }
  719. fn_info_message_goldsrc(){
  720. echo -e "netstat -atunp | grep hlds_linux"
  721. echo -e ""
  722. {
  723. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  724. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  725. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  726. } | column -s $'\t' -t
  727. }
  728. fn_info_message_hurtworld(){
  729. echo -e "netstat -atunp | grep Hurtworld"
  730. echo -e ""
  731. {
  732. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  733. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  734. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  735. } | column -s $'\t' -t
  736. }
  737. fn_info_message_inss(){
  738. echo -e "netstat -atunp | grep Insurgency"
  739. echo -e ""
  740. {
  741. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  742. echo -e "> Game\tINBOUND\t${port}\tudp"
  743. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  744. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  745. } | column -s $'\t' -t
  746. }
  747. fn_info_message_jk2(){
  748. echo -e "netstat -atunp | grep jk2mvded"
  749. echo -e ""
  750. {
  751. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  752. echo -e "> Game\tINBOUND\t${port}\tudp"
  753. } | column -s $'\t' -t
  754. }
  755. fn_info_message_justcause2(){
  756. echo -e "netstat -atunp | grep Jcmp-Server"
  757. echo -e ""
  758. {
  759. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  760. echo -e "> Game\tINBOUND\t${port}\tudp"
  761. } | column -s $'\t' -t
  762. }
  763. fn_info_message_justcause3(){
  764. echo -e "netstat -atunp | grep Server"
  765. echo -e ""
  766. {
  767. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  768. echo -e "> Game\tINBOUND\t${port}\tudp"
  769. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  770. echo -e "> Steam\tINBOUND\t${steamport}\tudp"
  771. } | column -s $'\t' -t
  772. }
  773. fn_info_message_minecraft(){
  774. echo -e "netstat -atunp | grep java"
  775. echo -e ""
  776. {
  777. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  778. echo -e "> Game\tINBOUND\t${port}\ttcp"
  779. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  780. echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
  781. } | column -s $'\t' -t
  782. }
  783. fn_info_message_minecraft_bedrock(){
  784. echo -e "netstat -atunp | grep bedrock_serv"
  785. echo -e ""
  786. {
  787. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  788. echo -e "> Game\tINBOUND\t${port}\tudp"
  789. echo -e "> Game\tINBOUND\t${port6}\tudp6"
  790. } | column -s $'\t' -t
  791. }
  792. fn_info_message_onset(){
  793. echo -e "netstat -atunp | grep OnsetServer"
  794. echo -e ""
  795. {
  796. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  797. echo -e "> Game\tINBOUND\t${port}\tudp"
  798. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  799. echo -e "> HTTP\tINBOUND\t${httpport}\ttcp"
  800. } | column -s $'\t' -t
  801. }
  802. fn_info_message_mohaa(){
  803. echo -e "netstat -atunp | grep mohaa_lnxded"
  804. echo -e ""
  805. {
  806. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  807. echo -e "> Game\tINBOUND\t${port}\tudp"
  808. } | column -s $'\t' -t
  809. }
  810. fn_info_message_mom(){
  811. echo -e "netstat -atunp | grep MemoriesOfMar"
  812. echo -e ""
  813. {
  814. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  815. echo -e "> Game\tINBOUND\t${port}\tudp"
  816. echo -e "> BeaconPort\tINBOUND\t${beaconport}\tudp"
  817. } | column -s $'\t' -t
  818. }
  819. fn_info_message_mumble(){
  820. echo -e "netstat -atunp | grep murmur"
  821. echo -e ""
  822. {
  823. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  824. echo -e "> Voice\tINBOUND\t${port}\tudp"
  825. echo -e "> ServerQuery\tINBOUND\t${port}\ttcp"
  826. } | column -s $'\t' -t
  827. }
  828. fn_info_message_pstbs(){
  829. echo -e "netstat -atunp | grep PostScriptum"
  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 "> RCON\tINBOUND\t${rconport}\ttcp"
  836. } | column -s $'\t' -t
  837. }
  838. fn_info_message_projectcars(){
  839. echo -e "netstat -atunp | grep DedicatedS"
  840. echo -e ""
  841. {
  842. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  843. echo -e "> Game\tINBOUND\t${port}\tudp"
  844. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  845. echo -e "> Steam\tINBOUND\t${steamport}\tudp"
  846. } | column -s $'\t' -t
  847. }
  848. fn_info_message_projectzomboid(){
  849. echo -e "netstat -atunp | grep ProjectZomb"
  850. echo -e ""
  851. {
  852. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  853. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  854. } | column -s $'\t' -t
  855. }
  856. fn_info_message_quake(){
  857. echo -e "netstat -atunp | grep mvdsv"
  858. echo -e ""
  859. {
  860. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  861. echo -e "> Game\tINBOUND\t${port}\tudp"
  862. } | column -s $'\t' -t
  863. }
  864. fn_info_message_quake2(){
  865. echo -e "netstat -atunp | grep quake2"
  866. echo -e ""
  867. {
  868. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  869. echo -e "> Game\tINBOUND\t${port}\tudp"
  870. } | column -s $'\t' -t
  871. }
  872. fn_info_message_quake3(){
  873. echo -e "netstat -atunp | grep q3ded"
  874. echo -e ""
  875. {
  876. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  877. echo -e "> Game\tINBOUND\t${port}\tudp"
  878. } | column -s $'\t' -t
  879. }
  880. fn_info_message_quakelive(){
  881. echo -e "netstat -atunp | grep qzeroded"
  882. echo -e ""
  883. if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then
  884. echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}."
  885. echo -e ""
  886. fi
  887. {
  888. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  889. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  890. echo -e "> Rcon\tINBOUND\t${rconport}\tudp"
  891. echo -e "> Stats\tINBOUND\t${statsport}\tudp"
  892. } | column -s $'\t' -t
  893. }
  894. fn_info_message_arma3(){
  895. echo -e "netstat -atunp | grep arma3server"
  896. echo -e ""
  897. # Default port
  898. if [ -z "${port}" ]; then
  899. port="2302"
  900. fi
  901. {
  902. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  903. echo -e "> Game\tINBOUND\t${port}\tudp"
  904. # Don't do arithmetics if ever the port wasn't a numeric value
  905. if [ "${port}" -eq "${port}" ]; then
  906. echo -e "> Query Steam\tINBOUND\t$((port+1))\tudp"
  907. echo -e "> Steam: Master traffic\tINBOUND\t$((port+2))\tudp"
  908. echo -e "> Undocumented Port\tINBOUND\t$((port+3))\tudp"
  909. fi
  910. } | column -s $'\t' -t
  911. }
  912. fn_info_message_bf1942(){
  913. echo -e "netstat -atunp | grep bf1942_lnxd"
  914. echo -e ""
  915. {
  916. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  917. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  918. echo -e "> Query Steam\tINBOUND\t${queryport}\tudp"
  919. } | column -s $'\t' -t
  920. }
  921. fn_info_message_bfv(){
  922. echo -e "netstat -atunp | grep bfv_linded"
  923. echo -e ""
  924. {
  925. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  926. echo -e "> Game\tINBOUND\t${port}\tudp"
  927. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  928. } | column -s $'\t' -t
  929. }
  930. fn_info_message_risingworld(){
  931. echo -e "netstat -atunp | grep java"
  932. echo -e ""
  933. {
  934. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  935. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  936. echo -e "> Query HTTP\tINBOUND\t${httpqueryport}\ttcp"
  937. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  938. } | column -s $'\t' -t
  939. }
  940. fn_info_message_rtcw(){
  941. echo -e "netstat -atunp | grep iowolfded"
  942. echo -e ""
  943. {
  944. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  945. echo -e "> Game\tINBOUND\t${port}\tudp"
  946. } | column -s $'\t' -t
  947. }
  948. fn_info_message_rust(){
  949. echo -e "netstat -atunp | grep Rust"
  950. echo -e ""
  951. {
  952. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  953. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  954. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  955. } | column -s $'\t' -t
  956. }
  957. fn_info_message_samp(){
  958. echo -e "netstat -atunp | grep samp03svr"
  959. echo -e ""
  960. {
  961. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  962. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  963. } | column -s $'\t' -t
  964. }
  965. fn_info_message_ss3(){
  966. echo -e "netstat -atunp | grep Sam3_Ded"
  967. echo -e ""
  968. {
  969. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  970. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp"
  971. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  972. } | column -s $'\t' -t
  973. }
  974. fn_info_message_sbots(){
  975. echo -e "netstat -atunp | grep blank1"
  976. echo -e ""
  977. {
  978. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  979. echo -e "> Game\tINBOUND\t${port}\tudp"
  980. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  981. } | column -s $'\t' -t
  982. }
  983. fn_info_message_sdtd(){
  984. fn_info_message_password_strip
  985. echo -e "netstat -atunp | grep 7DaysToDie"
  986. echo -e ""
  987. {
  988. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  989. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  990. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  991. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  992. echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
  993. } | column -s $'\t' -t
  994. echo -e ""
  995. echo -e "${lightgreen}${servername} WebAdmin${default}"
  996. fn_messages_separator
  997. {
  998. echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}"
  999. echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  1000. echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}"
  1001. } | column -s $'\t' -t
  1002. echo -e ""
  1003. echo -e "${lightgreen}${servername} Telnet${default}"
  1004. fn_messages_separator
  1005. {
  1006. echo -e "${lightblue}Telnet enabled:\t${default}${telnetenabled}"
  1007. echo -e "${lightblue}Telnet address:\t${default}${ip} ${telnetport}"
  1008. echo -e "${lightblue}Telnet password:\t${default}${telnetpass}"
  1009. } | column -s $'\t' -t
  1010. }
  1011. fn_info_message_sof2(){
  1012. echo -e "netstat -atunp | grep sof2ded"
  1013. echo -e ""
  1014. {
  1015. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1016. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  1017. } | column -s $'\t' -t
  1018. }
  1019. fn_info_message_source(){
  1020. echo -e "netstat -atunp | grep srcds_linux"
  1021. echo -e ""
  1022. {
  1023. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1024. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  1025. echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp"
  1026. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  1027. } | column -s $'\t' -t
  1028. }
  1029. fn_info_message_spark(){
  1030. fn_info_message_password_strip
  1031. echo -e "netstat -atunp | grep server_linux"
  1032. echo -e ""
  1033. {
  1034. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1035. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  1036. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1037. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  1038. } | column -s $'\t' -t
  1039. echo -e ""
  1040. echo -e "${lightgreen}${servername} WebAdmin${default}"
  1041. fn_messages_separator
  1042. {
  1043. echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}/index.html"
  1044. echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}"
  1045. echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}"
  1046. } | column -s $'\t' -t
  1047. }
  1048. fn_info_message_squad(){
  1049. echo -e "netstat -atunp | grep SquadServer"
  1050. echo -e ""
  1051. {
  1052. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1053. echo -e "> Game\tINBOUND\t${port}\tudp"
  1054. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1055. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  1056. } | column -s $'\t' -t
  1057. }
  1058. fn_info_message_starbound(){
  1059. echo -e "netstat -atunp | grep starbound"
  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. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  1066. } | column -s $'\t' -t
  1067. }
  1068. fn_info_message_stationeers(){
  1069. echo -e "netstat -atunp | grep rocketstation"
  1070. echo -e ""
  1071. {
  1072. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1073. echo -e "> Game\tINBOUND\t${port}\ttcp"
  1074. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  1075. } | column -s $'\t' -t
  1076. }
  1077. fn_info_message_teamspeak3(){
  1078. echo -e "netstat -atunp | grep ts3server"
  1079. echo -e ""
  1080. {
  1081. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1082. echo -e "> Voice\tINBOUND\t${port}\tudp"
  1083. echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp"
  1084. echo -e "> File transfer\tINBOUND\t${fileport}\ttcp"
  1085. } | column -s $'\t' -t
  1086. }
  1087. fn_info_message_teeworlds(){
  1088. echo -e "netstat -atunp | grep teeworlds"
  1089. echo -e ""
  1090. {
  1091. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1092. echo -e "> Game\Query\tINBOUND\t${port}\ttcp"
  1093. } | column -s $'\t' -t
  1094. }
  1095. fn_info_message_terraria(){
  1096. echo -e "netstat -atunp | grep Terraria"
  1097. echo -e ""
  1098. {
  1099. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1100. echo -e "> Game\tINBOUND\t${port}\ttcp"
  1101. } | column -s $'\t' -t
  1102. }
  1103. fn_info_message_towerunite(){
  1104. echo -e "netstat -atunp | grep TowerServer"
  1105. echo -e ""
  1106. {
  1107. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1108. echo -e "> Game\tINBOUND\t${port}\ttcp"
  1109. # Don't do arithmetics if ever the port wasn't a numeric value
  1110. if [ "${port}" -eq "${port}" ]; then
  1111. echo -e "> Steam\tINBOUND\t$((port+1))\tudp"
  1112. fi
  1113. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1114. } | column -s $'\t' -t
  1115. }
  1116. fn_info_message_unreal(){
  1117. fn_info_message_password_strip
  1118. echo -e "netstat -atunp | grep ucc-bin"
  1119. echo -e ""
  1120. {
  1121. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  1122. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  1123. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1124. if [ "${engine}" == "unreal" ]; then
  1125. echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp"
  1126. fi
  1127. if [ "${engine}" != "unreal" ]&&[ "${appid}" != "223250" ]; then
  1128. echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}"
  1129. fi
  1130. if [ "${appid}" == "215360" ]; then
  1131. echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp"
  1132. else
  1133. echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp"
  1134. fi
  1135. if [ "${appid}" ]; then
  1136. if [ "${appid}" == "223250" ]; then
  1137. echo -e "< Steam\tINBOUND\t20610\tudp"
  1138. else
  1139. echo -e "< Steam\tINBOUND\t20660\tudp"
  1140. fi
  1141. fi
  1142. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  1143. } | column -s $'\t' -t
  1144. echo -e ""
  1145. echo -e "${lightgreen}${servername} WebAdmin${default}"
  1146. fn_messages_separator
  1147. {
  1148. echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}"
  1149. echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  1150. echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}"
  1151. echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}"
  1152. } | column -s $'\t' -t
  1153. }
  1154. fn_info_message_unreal2(){
  1155. fn_info_message_password_strip
  1156. echo -e "netstat -atunp | grep ucc-bin"
  1157. echo -e ""
  1158. {
  1159. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  1160. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  1161. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1162. if [ "${appid}" != "223250" ]; then
  1163. echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}"
  1164. fi
  1165. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  1166. } | column -s $'\t' -t
  1167. echo -e ""
  1168. echo -e "${lightgreen}${servername} WebAdmin${default}"
  1169. fn_messages_separator
  1170. {
  1171. echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}"
  1172. echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  1173. echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}"
  1174. echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}"
  1175. } | column -s $'\t' -t
  1176. }
  1177. fn_info_message_unreal3(){
  1178. fn_info_message_password_strip
  1179. echo -e "netstat -atunp | grep ut3-bin"
  1180. echo -e ""
  1181. {
  1182. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1183. echo -e "> Game\tINBOUND\t${port}\tudp"
  1184. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1185. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  1186. } | column -s $'\t' -t
  1187. echo -e ""
  1188. echo -e "${lightgreen}${servername} WebAdmin${default}"
  1189. fn_messages_separator
  1190. {
  1191. echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}"
  1192. echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  1193. echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}"
  1194. echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}"
  1195. } | column -s $'\t' -t
  1196. }
  1197. fn_info_message_unturned(){
  1198. echo -e "netstat -atunp | grep Unturned"
  1199. echo -e ""
  1200. {
  1201. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1202. echo -e "> Game\tINBOUND\t${port}\tudp"
  1203. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1204. } | column -s $'\t' -t
  1205. }
  1206. fn_info_message_ut(){
  1207. echo -e "netstat -atunp | grep UE4Server"
  1208. echo -e ""
  1209. {
  1210. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1211. echo -e "> Game\tINBOUND\t${port}\tudp"
  1212. } | column -s $'\t' -t
  1213. }
  1214. fn_info_message_kf2(){
  1215. fn_info_message_password_strip
  1216. echo -e "netstat -atunp | grep KFGame"
  1217. echo -e ""
  1218. {
  1219. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1220. echo -e "> Game\tINBOUND\t${port}\ttcp\tPort=${port}"
  1221. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1222. echo -e "> Steam\tINBOUND\t20560\tudp"
  1223. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  1224. } | column -s $'\t' -t
  1225. echo -e ""
  1226. echo -e "${lightgreen}${servername} WebAdmin${default}"
  1227. fn_messages_separator
  1228. {
  1229. echo -e "${lightblue}WebAdmin enabled:\t${default}${webadminenabled}"
  1230. echo -e "${lightblue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  1231. echo -e "${lightblue}WebAdmin username:\t${default}${webadminuser}"
  1232. echo -e "${lightblue}WebAdmin password:\t${default}${webadminpass}"
  1233. } | column -s $'\t' -t
  1234. }
  1235. fn_info_message_wolfensteinenemyterritory(){
  1236. echo -e "netstat -atunp | grep etded"
  1237. echo -e ""
  1238. {
  1239. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1240. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  1241. } | column -s $'\t' -t
  1242. }
  1243. fn_info_message_wurmunlimited(){
  1244. echo -e "netstat -atunp | grep WurmServer"
  1245. echo -e ""
  1246. {
  1247. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1248. echo -e "> Game\tINBOUND\t${port}\ttcp"
  1249. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1250. } | column -s $'\t' -t
  1251. }
  1252. fn_info_message_mta(){
  1253. echo -e "netstat -atunp | grep mta-server"
  1254. echo -e ""
  1255. {
  1256. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1257. echo -e "> Game/Query\tOUTBOUND\t${port}\tudp"
  1258. echo -e "> HTTP Server\tINBOUND\t${httpport}\ttcp"
  1259. if [ "${ase}" == "Enabled" ]; then
  1260. echo -e "> Query Port\tOUTBOUND\t${queryport}\tudp"
  1261. fi
  1262. } | column -s $'\t' -t
  1263. }
  1264. fn_info_message_mordhau(){
  1265. echo -e "netstat -atunp | grep Mord"
  1266. echo -e ""
  1267. {
  1268. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1269. echo -e "> Game\tINBOUND\t${port}\tudp"
  1270. echo -e "> BeaconPort\tINBOUND\t${beaconport}\tudp"
  1271. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1272. } | column -s $'\t' -t
  1273. }
  1274. fn_info_message_barotrauma(){
  1275. echo -e "netstat -atunp | grep /./Server.bin"
  1276. echo -e ""
  1277. {
  1278. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1279. echo -e "> Game\tINBOUND\t${port}\tudp"
  1280. echo -e "> Query\tINBOUND\t$((port+1))\tudp"
  1281. } | column -s $'\t' -t
  1282. }
  1283. fn_info_message_soldat() {
  1284. echo -e "netstat -atunp | grep soldat"
  1285. echo -e ""
  1286. {
  1287. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1288. echo -e "> Game\tINBOUND\t${port}\tudp"
  1289. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  1290. echo -e "> FILES\tINBOUND\t$((port+10))\ttcp"
  1291. } | column -s $'\t' -t
  1292. }
  1293. fn_info_message_warfork(){
  1294. echo -e "netstat -atunp | grep wf_server"
  1295. echo -e ""
  1296. {
  1297. echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
  1298. echo -e "> Game\tINBOUND\t${port}\tudp"
  1299. echo -e "> HTTP\tINBOUND\t${httpport}\ttcp"
  1300. } | column -s $'\t' -t
  1301. }
  1302. fn_info_message_select_engine(){
  1303. # Display details depending on game or engine.
  1304. if [ "${shortname}" == "ac" ]; then
  1305. fn_info_message_assettocorsa
  1306. elif [ "${shortname}" == "ark" ]; then
  1307. fn_info_message_ark
  1308. elif [ "${shortname}" == "av" ]; then
  1309. fn_info_message_avorion
  1310. elif [ "${shortname}" == "arma3" ]; then
  1311. fn_info_message_arma3
  1312. elif [ "${shortname}" == "bo" ]; then
  1313. fn_info_message_ballisticoverkill
  1314. elif [ "${shortname}" == "bt" ]; then
  1315. fn_info_message_barotrauma
  1316. elif [ "${shortname}" == "bt1944" ]; then
  1317. fn_info_message_battalion1944
  1318. elif [ "${shortname}" == "cmw" ]; then
  1319. fn_info_message_chivalry
  1320. elif [ "${shortname}" == "cod" ]; then
  1321. fn_info_message_cod
  1322. elif [ "${shortname}" == "coduo" ]; then
  1323. fn_info_message_coduo
  1324. elif [ "${shortname}" == "cod2" ]; then
  1325. fn_info_message_cod2
  1326. elif [ "${shortname}" == "cod4" ]; then
  1327. fn_info_message_cod4
  1328. elif [ "${shortname}" == "codwaw" ]; then
  1329. fn_info_message_codwaw
  1330. elif [ "${shortname}" == "dst" ]; then
  1331. fn_info_message_dst
  1332. elif [ "${shortname}" == "eco" ]; then
  1333. fn_info_message_eco
  1334. elif [ "${shortname}" == "etl" ]; then
  1335. fn_info_message_etlegacy
  1336. elif [ "${shortname}" == "fctr" ]; then
  1337. fn_info_message_factorio
  1338. elif [ "${shortname}" == "hw" ]; then
  1339. fn_info_message_hurtworld
  1340. elif [ "${shortname}" == "inss" ]; then
  1341. fn_info_message_inss
  1342. elif [ "${shortname}" == "jk2" ]; then
  1343. fn_info_message_jk2
  1344. elif [ "${shortname}" == "jc2" ]; then
  1345. fn_info_message_justcause2
  1346. elif [ "${shortname}" == "jc3" ]; then
  1347. fn_info_message_justcause3
  1348. elif [ "${shortname}" == "kf2" ]; then
  1349. fn_info_message_kf2
  1350. elif [ "${shortname}" == "mcb" ]; then
  1351. fn_info_message_minecraft_bedrock
  1352. elif [ "${shortname}" == "onset" ]; then
  1353. fn_info_message_onset
  1354. elif [ "${shortname}" == "mom" ]; then
  1355. fn_info_message_mom
  1356. elif [ "${shortname}" == "pz" ]; then
  1357. fn_info_message_projectzomboid
  1358. elif [ "${shortname}" == "pstbs" ]; then
  1359. fn_info_message_pstbs
  1360. elif [ "${shortname}" == "pc" ]; then
  1361. fn_info_message_projectcars
  1362. elif [ "${shortname}" == "qw" ]; then
  1363. fn_info_message_quake
  1364. elif [ "${shortname}" == "q2" ]; then
  1365. fn_info_message_quake2
  1366. elif [ "${shortname}" == "q3" ]; then
  1367. fn_info_message_quake3
  1368. elif [ "${shortname}" == "ql" ]; then
  1369. fn_info_message_quakelive
  1370. elif [ "${shortname}" == "samp" ]; then
  1371. fn_info_message_samp
  1372. elif [ "${shortname}" == "sdtd" ]; then
  1373. fn_info_message_sdtd
  1374. elif [ "${shortname}" == "squad" ]; then
  1375. fn_info_message_squad
  1376. elif [ "${shortname}" == "st" ]; then
  1377. fn_info_message_stationeers
  1378. elif [ "${shortname}" == "sof2" ]; then
  1379. fn_info_message_sof2
  1380. elif [ "${shortname}" == "sol" ]; then
  1381. fn_info_message_soldat
  1382. elif [ "${shortname}" == "sb" ]; then
  1383. fn_info_message_starbound
  1384. elif [ "${shortname}" == "sbots" ]; then
  1385. fn_info_message_sbots
  1386. elif [ "${shortname}" == "ss3" ]; then
  1387. fn_info_message_ss3
  1388. elif [ "${shortname}" == "terraria" ]; then
  1389. fn_info_message_terraria
  1390. elif [ "${shortname}" == "ts3" ]; then
  1391. fn_info_message_teamspeak3
  1392. elif [ "${shortname}" == "tu" ]; then
  1393. fn_info_message_towerunite
  1394. elif [ "${shortname}" == "tw" ]; then
  1395. fn_info_message_teeworlds
  1396. elif [ "${shortname}" == "unt" ]; then
  1397. fn_info_message_unturned
  1398. elif [ "${shortname}" == "ut" ]; then
  1399. fn_info_message_ut
  1400. elif [ "${shortname}" == "mc" ]; then
  1401. fn_info_message_minecraft
  1402. elif [ "${shortname}" == "mh" ]; then
  1403. fn_info_message_mordhau
  1404. elif [ "${shortname}" == "mohaa" ]; then
  1405. fn_info_message_mohaa
  1406. elif [ "${shortname}" == "mta" ]; then
  1407. fn_info_message_mta
  1408. elif [ "${shortname}" == "mumble" ]; then
  1409. fn_info_message_mumble
  1410. elif [ "${shortname}" == "bf1942" ]; then
  1411. fn_info_message_bf1942
  1412. elif [ "${shortname}" == "bfv" ]; then
  1413. fn_info_message_bfv
  1414. elif [ "${shortname}" == "rtcw" ]; then
  1415. fn_info_message_rtcw
  1416. elif [ "${shortname}" == "rust" ]; then
  1417. fn_info_message_rust
  1418. elif [ "${shortname}" == "wf" ]; then
  1419. fn_info_message_warfork
  1420. elif [ "${shortname}" == "wurm" ]; then
  1421. fn_info_message_wurmunlimited
  1422. elif [ "${shortname}" == "rw" ]; then
  1423. fn_info_message_risingworld
  1424. elif [ "${shortname}" == "wet" ]; then
  1425. fn_info_message_wolfensteinenemyterritory
  1426. elif [ "${engine}" == "goldsrc" ]; then
  1427. fn_info_message_goldsrc
  1428. elif [ "${engine}" == "source" ]; then
  1429. fn_info_message_source
  1430. elif [ "${engine}" == "spark" ]; then
  1431. fn_info_message_spark
  1432. elif [ "${engine}" == "unreal" ]; then
  1433. fn_info_message_unreal
  1434. elif [ "${engine}" == "unreal2" ]; then
  1435. fn_info_message_unreal2
  1436. elif [ "${engine}" == "unreal3" ]; then
  1437. fn_info_message_unreal3
  1438. else
  1439. fn_print_error_nl "Unable to detect server engine."
  1440. fi
  1441. }
  1442. # Separator is different for details
  1443. fn_messages_separator(){
  1444. if [ "${commandname}" == "details" ]; then
  1445. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  1446. else
  1447. echo -e "================================="
  1448. fi
  1449. }
  1450. # Removes the passwords form all but details
  1451. fn_info_message_password_strip(){
  1452. if [ "${commandname}" != "DETAILS" ]; then
  1453. if [ "${serverpassword}" ]; then
  1454. serverpassword="********"
  1455. fi
  1456. if [ "${rconpassword}" ]; then
  1457. rconpassword="********"
  1458. fi
  1459. if [ "${adminpassword}" ]; then
  1460. adminpassword="********"
  1461. fi
  1462. if [ "${statspassword}" ]; then
  1463. statspassword="********"
  1464. fi
  1465. if [ "${webadminpass}" ]; then
  1466. webadminpass="********"
  1467. fi
  1468. if [ "${telnetpass}" ]; then
  1469. telnetpass="********"
  1470. fi
  1471. if [ "${wsapikey}" ]; then
  1472. wsapikey="********"
  1473. fi
  1474. if [ "${gslt}" ]; then
  1475. gslt="********"
  1476. fi
  1477. fi
  1478. }