info_messages.sh 48 KB

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