info_messages.sh 47 KB

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