info_messages.sh 50 KB

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