info_messages.sh 48 KB

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