info_messages.sh 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117
  1. #!/bin/bash
  2. # LinuxGSM info_messages.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://gameservermanagers.com
  5. # Description: Defines server info messages for details, alerts.
  6. # Standard Details
  7. # This applies to all engines
  8. fn_info_message_head(){
  9. echo -e ""
  10. echo -e "${lightyellow}Summary${default}"
  11. fn_messages_separator
  12. echo -e "Message"
  13. echo -e "${alertbody}"
  14. echo -e ""
  15. echo -e "Game"
  16. echo -e "${gamename}"
  17. echo -e ""
  18. echo -e "Server name"
  19. echo -e "${servername}"
  20. echo -e ""
  21. echo -e "Hostname"
  22. echo -e "${HOSTNAME}"
  23. echo -e ""
  24. echo -e "Server IP"
  25. echo -e "${ip}:${port}"
  26. }
  27. fn_info_message_distro(){
  28. #
  29. # Distro Details
  30. # =====================================
  31. # Distro: Ubuntu 14.04.4 LTS
  32. # Arch: x86_64
  33. # Kernel: 3.13.0-79-generic
  34. # Hostname: hostname
  35. # tmux: tmux 1.8
  36. # GLIBC: 2.19
  37. echo -e ""
  38. echo -e "${lightyellow}Distro Details${default}"
  39. fn_messages_separator
  40. {
  41. echo -e "${blue}Distro:\t${default}${distroname}"
  42. echo -e "${blue}Arch:\t${default}${arch}"
  43. echo -e "${blue}Kernel:\t${default}${kernel}"
  44. echo -e "${blue}Hostname:\t${default}${HOSTNAME}"
  45. echo -e "${blue}tmux:\t${default}${tmuxv}"
  46. echo -e "${blue}GLIBC:\t${default}${glibcversion}"
  47. } | column -s $'\t' -t
  48. }
  49. fn_info_message_performance(){
  50. #
  51. # Performance
  52. # =====================================
  53. # Uptime: 55d, 3h, 38m
  54. # Avg Load: 1.00, 1.01, 0.78
  55. #
  56. # Mem: total used free cached
  57. # Physical: 741M 656M 85M 256M
  58. # Swap: 0B 0B 0B
  59. echo -e ""
  60. echo -e "${lightyellow}Performance${default}"
  61. {
  62. echo -e "${blue}Uptime:\t${default}${days}d, ${hours}h, ${minutes}m"
  63. echo -e "${blue}Avg Load:\t${default}${load}"
  64. } | column -s $'\t' -t
  65. echo -e ""
  66. {
  67. echo -e "${blue}Mem:\t${blue}total\t used\t free\t cached${default}"
  68. echo -e "${blue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}${default}"
  69. echo -e "${blue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}"
  70. } | column -s $'\t' -t
  71. }
  72. fn_info_message_disk(){
  73. #
  74. # Storage
  75. # =====================================
  76. # Filesystem: /dev/disk/by-uuid/320c8edd-a2ce-4a23-8c9d-e00a7af2d6ff
  77. # Total: 15G
  78. # Used: 8.4G
  79. # Available: 5.7G
  80. # LinuxGSM Total: 1G
  81. # Serverfiles: 961M
  82. # Backups: 2G
  83. echo -e ""
  84. echo -e "${lightyellow}Storage${default}"
  85. fn_messages_separator
  86. {
  87. echo -e "${blue}Filesystem:\t${default}${filesystem}"
  88. echo -e "${blue}Total:\t${default}${totalspace}"
  89. echo -e "${blue}Used:\t${default}${usedspace}"
  90. echo -e "${blue}Available:\t${default}${availspace}"
  91. echo -e "${blue}LinuxGSM Total:\t${default}${rootdirdu}"
  92. echo -e "${blue}Serverfiles:\t${default}${serverfilesdu}"
  93. if [ -d "${backupdir}" ]; then
  94. echo -e "${blue}Backups:\t${default}${backupdirdu}"
  95. fi
  96. } | column -s $'\t' -t
  97. }
  98. fn_info_message_gameserver(){
  99. #
  100. # Quake Live Server Details
  101. # =====================================
  102. # Server name: ql-server
  103. # Server IP: 1.2.3.4:27960
  104. # RCON password: CHANGE_ME
  105. # Server password: NOT SET
  106. # Maxplayers: 16
  107. # Status: OFFLINE
  108. echo -e ""
  109. echo -e "${lightgreen}${gamename} Server Details${default}"
  110. fn_info_message_password_strip
  111. fn_messages_separator
  112. {
  113. # Server name
  114. if [ -n "${servername}" ]; then
  115. echo -e "${blue}Server name:\t${default}${servername}"
  116. fi
  117. # Server description
  118. if [ -n "${serverdescription}" ]; then
  119. echo -e "${blue}Server Description:\t${default}${serverdescription}"
  120. fi
  121. # Branch
  122. if [ -n "${branch}" ]; then
  123. echo -e "${blue}Branch:\t${default}${branch}"
  124. fi
  125. # Server ip
  126. echo -e "${blue}Server IP:\t${default}${ip}:${port}"
  127. # External server ip
  128. if [ -n "${extip}" ]; then
  129. if [ "${ip}" != "${extip}" ]; then
  130. echo -e "${blue}Internet IP:\t${default}${extip}:${port}"
  131. fi
  132. fi
  133. # Server password
  134. if [ -n "${serverpassword}" ]; then
  135. echo -e "${blue}Server password:\t${default}${serverpassword}"
  136. fi
  137. # Query enabled (Starbound)
  138. if [ -n "${queryenabled}" ]; then
  139. echo -e "${blue}Query enabled:\t${default}${rconpassword}"
  140. fi
  141. # RCON enabled (Starbound)
  142. if [ -n "${rconenabled}" ]; then
  143. echo -e "${blue}RCON enabled:\t${default}${rconpassword}"
  144. fi
  145. # RCON password
  146. if [ -n "${rconpassword}" ]; then
  147. echo -e "${blue}RCON password:\t${default}${rconpassword}"
  148. fi
  149. # RCON web (Rust)
  150. if [ -n "${rconweb}" ]; then
  151. echo -e "${blue}RCON web:\t${default}${rconweb}"
  152. fi
  153. # Admin password
  154. if [ -n "${adminpassword}" ]; then
  155. echo -e "${blue}Admin password:\t${default}${adminpassword}"
  156. fi
  157. # Stats password (Quake Live)
  158. if [ -n "${statspassword}" ]; then
  159. echo -e "${blue}Stats password:\t${default}${statspassword}"
  160. fi
  161. # Maxplayers
  162. if [ -n "${maxplayers}" ]; then
  163. echo -e "${blue}Maxplayers:\t${default}${maxplayers}"
  164. fi
  165. # Game mode
  166. if [ -n "${gamemode}" ]; then
  167. echo -e "${blue}Game mode:\t${default}${gamemode}"
  168. fi
  169. # Game world
  170. if [ -n "${gameworld}" ]; then
  171. echo -e "${blue}Game world:\t${default}${gameworld}"
  172. fi
  173. # Tick rate
  174. if [ -n "${tickrate}" ]; then
  175. echo -e "${blue}Tick rate:\t${default}${tickrate}"
  176. fi
  177. # Sharding (Don't Starve Together)
  178. if [ -n "${sharding}" ]; then
  179. echo -e "${blue}Sharding:\t${default}${sharding}"
  180. fi
  181. # Master (Don't Starve Together)
  182. if [ -n "${master}" ]; then
  183. echo -e "${blue}Master:\t${default}${master}"
  184. fi
  185. # Shard (Don't Starve Together)
  186. if [ -n "${shard}" ]; then
  187. echo -e "${blue}Shard:\t${default}${shard}"
  188. fi
  189. # Cluster (Don't Starve Together)
  190. if [ -n "${cluster}" ]; then
  191. echo -e "${blue}Cluster:\t${default}${cluster}"
  192. fi
  193. # Cave (Don't Starve Together)
  194. if [ -n "${cave}" ]; then
  195. echo -e "${blue}Cave:\t${default}${cave}"
  196. fi
  197. # Creativemode (Hurtworld)
  198. if [ -n "${creativemode}" ]; then
  199. echo -e "${blue}Creativemode:\t${default}${creativemode}"
  200. fi
  201. # TeamSpeak dbplugin
  202. if [ -n "${dbplugin}" ]; then
  203. echo -e "${blue}dbplugin:\t${default}${dbplugin}"
  204. fi
  205. # ASE (Multi Theft Auto)
  206. if [ -n "${ase}" ]; then
  207. echo -e "${blue}ASE:\t${default}${ase}"
  208. fi
  209. # Save interval (Rust)
  210. if [ -n "${saveinterval}" ]; then
  211. echo -e "${blue}ASE:\t${default}${saveinterval} s"
  212. fi
  213. # Random map rotation mode (Squad)
  214. if [ -n "${randommap}" ]; then
  215. echo -e "${blue}Map rotation:\t${default}${randommap}"
  216. fi
  217. # Online status
  218. if [ "${status}" == "0" ]; then
  219. echo -e "${blue}Status:\t${red}OFFLINE${default}"
  220. else
  221. echo -e "${blue}Status:\t${green}ONLINE${default}"
  222. fi
  223. } | column -s $'\t' -t
  224. echo -e ""
  225. }
  226. fn_info_message_script(){
  227. #
  228. # qlserver Script Details
  229. # =====================================
  230. # Service name: ql-server
  231. # qlserver version: 150316
  232. # User: lgsm
  233. # Email alert: off
  234. # Update on start: off
  235. # Location: /home/lgsm/qlserver
  236. # Config file: /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg
  237. echo -e "${lightgreen}${selfname} Script Details${default}"
  238. fn_messages_separator
  239. {
  240. # Service name
  241. echo -e "${blue}Service name:\t${default}${servicename}"
  242. # Script version
  243. if [ -n "${version}" ]; then
  244. echo -e "${blue}${selfname} version:\t${default}${version}"
  245. fi
  246. # User
  247. echo -e "${blue}User:\t${default}$(whoami)"
  248. # GLIBC required
  249. if [ -n "${glibcrequired}" ]; then
  250. if [ "${glibcrequired}" == "NOT REQUIRED" ]; then
  251. :
  252. elif [ "${glibcrequired}" == "UNKNOWN" ]; then
  253. echo -e "${blue}GLIBC required:\t${red}${glibcrequired}"
  254. elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then
  255. if [ "${glibcfix}" == "yes" ]; then
  256. echo -e "${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${green}Using GLIBC fix${default})"
  257. else
  258. echo -e "${blue}GLIBC required:\t${red}${glibcrequired} ${default}(${red}GLIBC version too old${default})"
  259. fi
  260. else
  261. echo -e "${blue}GLIBC required:\t${green}${glibcrequired}${default}"
  262. fi
  263. fi
  264. # Discord alert
  265. echo -e "${blue}Discord alert:\t${default}${discordalert}"
  266. # Email alert
  267. echo -e "${blue}Email alert:\t${default}${emailalert}"
  268. # Pushbullet alert
  269. echo -e "${blue}Pushbullet alert:\t${default}${pushbulletalert}"
  270. # IFTTT alert
  271. echo -e "${blue}IFTTT alert:\t${default}${iftttalert}"
  272. # Mailgun alert
  273. echo -e "${blue}Mailgun (email) alert:\t${default}${mailgunalert}"
  274. # Pushover alert
  275. echo -e "${blue}Pushover alert:\t${default}${pushoveralert}"
  276. # Telegram alert
  277. echo -e "${blue}Telegram alert:\t${default}${telegramalert}"
  278. # Update on start
  279. if [ -n "${updateonstart}" ]; then
  280. echo -e "${blue}Update on start:\t${default}${updateonstart}"
  281. fi
  282. # Script location
  283. echo -e "${blue}Location:\t${default}${rootdir}"
  284. # Config file location
  285. if [ -n "${servercfgfullpath}" ]; then
  286. if [ -f "${servercfgfullpath}" ]; then
  287. echo -e "${blue}Config file:\t${default}${servercfgfullpath}"
  288. elif [ -d "${servercfgfullpath}" ]; then
  289. echo -e "${blue}Config dir:\t${default}${servercfgfullpath}"
  290. else
  291. echo -e "${blue}Config file:\t${default}${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})"
  292. fi
  293. fi
  294. # Network config file location (ARMA 3)
  295. if [ -n "${networkcfgfullpath}" ]; then
  296. echo -e "${blue}Network config file:\t${default}${networkcfgfullpath}"
  297. fi
  298. } | column -s $'\t' -t
  299. }
  300. fn_info_message_backup(){
  301. #
  302. # Backups
  303. # =====================================
  304. # No. of backups: 1
  305. # Latest backup:
  306. # date: Fri May 6 18:34:19 UTC 2016
  307. # file: /home/lgsm/qlserver/backups/ql-server-2016-05-06-183239.tar.gz
  308. # size: 945M
  309. echo -e ""
  310. echo -e "${lightgreen}Backups${default}"
  311. fn_messages_separator
  312. if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then
  313. echo -e "No Backups created"
  314. else
  315. {
  316. echo -e "${blue}No. of backups:\t${default}${backupcount}"
  317. echo -e "${blue}Latest backup:${default}"
  318. if [ "${lastbackupdaysago}" == "0" ]; then
  319. echo -e "${blue} date:\t${default}${lastbackupdate} (less than 1 day ago)"
  320. elif [ "${lastbackupdaysago}" == "1" ]; then
  321. echo -e "${blue} date:\t${default}${lastbackupdate} (1 day ago)"
  322. else
  323. echo -e "${blue} date:\t${default}${lastbackupdate} (${lastbackupdaysago} days ago)"
  324. fi
  325. echo -e "${blue} file:\t${default}${lastbackup}"
  326. echo -e "${blue} size:\t${default}${lastbackupsize}"
  327. } | column -s $'\t' -t
  328. fi
  329. }
  330. fn_info_message_commandlineparms(){
  331. #
  332. # Command-line Parameters
  333. # =====================================
  334. # ./run_server_x86.sh +set net_strict 1
  335. echo -e ""
  336. echo -e "${lightgreen}Command-line Parameters${default}"
  337. fn_info_message_password_strip
  338. fn_messages_separator
  339. echo -e "${executable} ${parms}"
  340. }
  341. fn_info_message_ports(){
  342. # Ports
  343. # =====================================
  344. # Change ports by editing the parameters in:
  345. # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg
  346. echo -e ""
  347. echo -e "${lightgreen}Ports${default}"
  348. fn_messages_separator
  349. echo -e "Change ports by editing the parameters in:"
  350. parmslocation="${red}UNKNOWN${default}"
  351. # engines/games that require editing in the config file
  352. local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "dontstarve" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" )
  353. for port_edit in "${ports_edit_array[@]}"
  354. do
  355. if [ "${shortname}" == "ut3" ]; then
  356. parmslocation="${servercfgdir}/UTEngine.ini\n${servercfgdir}/UTWeb.ini"
  357. elif [ "${shortname}" == "kf2" ]; then
  358. parmslocation="${servercfgdir}/LinuxServer-KFEngine.ini\n${servercfgdir}/KFWeb.ini"
  359. elif [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
  360. parmslocation="${servercfgfullpath}"
  361. fi
  362. done
  363. # engines/games that require editing in the script file
  364. local ports_edit_array=( "goldsource" "Factorio" "Hurtworld" "iw3.0" "Rust" "spark" "source" "starbound" "unreal4" "realvirtuality")
  365. for port_edit in "${ports_edit_array[@]}"
  366. do
  367. if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
  368. parmslocation="${selfname}"
  369. fi
  370. done
  371. echo -e "${parmslocation}"
  372. echo -e ""
  373. echo -e "Useful port diagnostic command:"
  374. }
  375. fn_info_message_statusbottom(){
  376. echo -e ""
  377. if [ "${status}" == "0" ]; then
  378. echo -e "${blue}Status:\t${red}OFFLINE${default}"
  379. else
  380. echo -e "${blue}Status:\t${green}ONLINE${default}"
  381. fi
  382. echo -e ""
  383. }
  384. fn_info_logs(){
  385. echo -e ""
  386. echo -e "${servicename} Logs"
  387. echo -e "================================="
  388. if [ -n "${lgsmlog}" ]; then
  389. echo -e "\nScript log\n==================="
  390. if [ ! "$(ls -A ${lgsmlogdir})" ]; then
  391. echo "${lgsmlogdir} (NO LOG FILES)"
  392. elif [ ! -s "${lgsmlog}" ]; then
  393. echo "${lgsmlog} (LOG FILE IS EMPTY)"
  394. else
  395. echo "${lgsmlog}"
  396. tail -25 "${lgsmlog}"
  397. fi
  398. echo ""
  399. fi
  400. if [ -n "${consolelog}" ]; then
  401. echo -e "\nConsole log\n===================="
  402. if [ ! "$(ls -A ${consolelogdir})" ]; then
  403. echo "${consolelogdir} (NO LOG FILES)"
  404. elif [ ! -s "${consolelog}" ]; then
  405. echo "${consolelog} (LOG FILE IS EMPTY)"
  406. else
  407. echo "${consolelog}"
  408. tail -25 "${consolelog}" | awk '{ sub("\r$", ""); print }'
  409. fi
  410. echo ""
  411. fi
  412. if [ -n "${gamelogdir}" ]; then
  413. echo -e "\nServer log\n==================="
  414. if [ ! "$(ls -A ${gamelogdir})" ]; then
  415. echo "${gamelogdir} (NO LOG FILES)"
  416. else
  417. echo "${gamelogdir}"
  418. # dos2unix sed 's/\r//'
  419. tail "${gamelogdir}"/* 2>/dev/null | grep -v "==>" | sed '/^$/d' | sed 's/\r//'| tail -25
  420. fi
  421. echo ""
  422. fi
  423. }
  424. # Engine/Game Specific details
  425. fn_info_message_ark(){
  426. echo -e "netstat -atunp | grep ShooterGame"
  427. echo -e ""
  428. {
  429. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  430. echo -e "> Game\tINBOUND\t${port}\tudp"
  431. # Don't do arithmetics if ever the port wasn't a numeric value
  432. if [ "${port}" -eq "${port}" ]; then
  433. echo -e "> RAW\tINBOUND\t$((port+1))\tudp"
  434. fi
  435. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  436. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  437. } | column -s $'\t' -t
  438. }
  439. fn_info_message_ballisticoverkill(){
  440. echo -e "netstat -atunp | grep BODS.x86"
  441. echo -e ""
  442. {
  443. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  444. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  445. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  446. } | column -s $'\t' -t
  447. }
  448. fn_info_message_cod(){
  449. echo -e "netstat -atunp | grep cod_lnxded"
  450. echo -e ""
  451. {
  452. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  453. echo -e "> Game\tINBOUND\t${port}\tudp"
  454. } | column -s $'\t' -t
  455. }
  456. fn_info_message_coduo(){
  457. echo -e "netstat -atunp | grep coduo_lnxded"
  458. echo -e ""
  459. {
  460. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  461. echo -e "> Game\tINBOUND\t${port}\tudp"
  462. } | column -s $'\t' -t
  463. }
  464. fn_info_message_cod2(){
  465. echo -e "netstat -atunp | grep cod2_lnxded"
  466. echo -e ""
  467. {
  468. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  469. echo -e "> Game\tINBOUND\t${port}\tudp"
  470. } | column -s $'\t' -t
  471. }
  472. fn_info_message_cod4(){
  473. echo -e "netstat -atunp"
  474. echo -e ""
  475. {
  476. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  477. echo -e "> Game\tINBOUND\t${port}\tudp"
  478. } | column -s $'\t' -t
  479. }
  480. fn_info_message_codwaw(){
  481. echo -e "netstat -atunp | grep codwaw_lnxded"
  482. echo -e ""
  483. {
  484. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  485. echo -e "> Game\tINBOUND\t${port}\tudp"
  486. } | column -s $'\t' -t
  487. }
  488. fn_info_message_dontstarve(){
  489. echo -e "netstat -atunp | grep dontstarve"
  490. echo -e ""
  491. {
  492. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  493. echo -e "> Game: Server\tINBOUND\t${port}\tudp"
  494. echo -e "> Game: Master\tINBOUND\t${masterport}\tudp"
  495. echo -e "> Steam: Auth\tINBOUND\t${steamauthenticationport}\tudp"
  496. echo -e "> Steam: Master\tINBOUND\t${steammasterserverport}\tudp"
  497. } | column -s $'\t' -t
  498. }
  499. fn_info_message_factorio(){
  500. echo -e "netstat -atunp | grep factorio"
  501. echo -e ""
  502. {
  503. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  504. echo -e "> Game\tINBOUND\t${port}\ttcp"
  505. } | column -s $'\t' -t
  506. }
  507. fn_info_message_goldsource(){
  508. echo -e "netstat -atunp | grep hlds_linux"
  509. echo -e ""
  510. {
  511. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  512. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  513. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  514. } | column -s $'\t' -t
  515. }
  516. fn_info_message_hurtworld(){
  517. echo -e "netstat -atunp | grep Hurtworld"
  518. echo -e ""
  519. {
  520. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  521. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  522. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  523. } | column -s $'\t' -t
  524. }
  525. fn_info_message_justcause2(){
  526. echo -e "netstat -atunp | grep Jcmp-Server"
  527. echo -e ""
  528. {
  529. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  530. echo -e "> Game\tINBOUND\t${port}\tudp"
  531. } | column -s $'\t' -t
  532. }
  533. fn_info_message_justcause3(){
  534. echo -e "netstat -atunp | grep Server"
  535. echo -e ""
  536. {
  537. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  538. echo -e "> Game\tINBOUND\t${port}\tudp"
  539. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  540. echo -e "> Steam\tINBOUND\t${steamport}\tudp"
  541. } | column -s $'\t' -t
  542. }
  543. fn_info_message_minecraft(){
  544. echo -e "netstat -atunp | grep java"
  545. echo -e ""
  546. {
  547. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  548. echo -e "> Game\tINBOUND\t${port}\ttcp"
  549. } | column -s $'\t' -t
  550. }
  551. fn_info_message_mumble(){
  552. echo -e "netstat -atunp | grep murmur"
  553. echo -e ""
  554. {
  555. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  556. echo -e "> Voice\tINBOUND\t${port}\tudp"
  557. echo -e "> ServerQuery\tINBOUND\t${port}\ttcp"
  558. } | column -s $'\t' -t
  559. }
  560. fn_info_message_projectcars(){
  561. echo -e "netstat -atunp | grep DedicatedS"
  562. echo -e ""
  563. {
  564. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  565. echo -e "> Game\tINBOUND\t${port}\tudp"
  566. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  567. echo -e "> Steam\tINBOUND\t${steamport}\tudp"
  568. } | column -s $'\t' -t
  569. }
  570. fn_info_message_projectzomboid(){
  571. echo -e "netstat -atunp | grep java"
  572. echo -e ""
  573. {
  574. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  575. echo -e "> Game\tINBOUND\t${port}\tudp"
  576. } | column -s $'\t' -t
  577. }
  578. fn_info_message_quake(){
  579. echo -e "netstat -atunp | grep mvdsv"
  580. echo -e ""
  581. {
  582. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  583. echo -e "> Game\tINBOUND\t${port}\tudp"
  584. } | column -s $'\t' -t
  585. }
  586. fn_info_message_quake2(){
  587. echo -e "netstat -atunp | grep quake2"
  588. echo -e ""
  589. {
  590. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  591. echo -e "> Game\tINBOUND\t${port}\tudp"
  592. } | column -s $'\t' -t
  593. }
  594. fn_info_message_quake3(){
  595. echo -e "netstat -atunp | grep q3ded"
  596. echo -e ""
  597. {
  598. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  599. echo -e "> Game\tINBOUND\t${port}\tudp"
  600. } | column -s $'\t' -t
  601. }
  602. fn_info_message_quakelive(){
  603. echo -e "netstat -atunp | grep qzeroded"
  604. echo -e ""
  605. if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then
  606. echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}."
  607. echo -e ""
  608. fi
  609. {
  610. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  611. echo -e "> Game\tINBOUND\t${port}\tudp"
  612. echo -e "> Rcon\tINBOUND\t${rconport}\tudp"
  613. echo -e "> Stats\tINBOUND\t${statsport}\tudp"
  614. } | column -s $'\t' -t
  615. }
  616. fn_info_message_realvirtuality(){
  617. echo -e "netstat -atunp | grep arma3server"
  618. echo -e ""
  619. # Default port
  620. if [ -z "${port}" ]; then
  621. port="2302"
  622. fi
  623. {
  624. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  625. echo -e "> Game\tINBOUND\t${port}\tudp"
  626. # Don't do arithmetics if ever the port wasn't a numeric value
  627. if [ "${port}" -eq "${port}" ]; then
  628. echo -e "> Steam: Query\tINBOUND\t$((port+1))\tudp"
  629. echo -e "> Steam: Master traffic\tINBOUND\t$((port+2))\tudp"
  630. echo -e "> Undocumented Port\tINBOUND\t$((port+3))\tudp"
  631. fi
  632. } | column -s $'\t' -t
  633. }
  634. fn_info_message_refractor(){
  635. echo -e "netstat -atunp | grep bf1942_lnxd"
  636. echo -e ""
  637. {
  638. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  639. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  640. echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp"
  641. } | column -s $'\t' -t
  642. }
  643. fn_info_message_rust(){
  644. echo -e "netstat -atunp | grep Rust"
  645. echo -e ""
  646. {
  647. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  648. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  649. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  650. } | column -s $'\t' -t
  651. }
  652. fn_info_message_samp(){
  653. echo -e "netstat -atunp | grep samp03svr"
  654. echo -e ""
  655. {
  656. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  657. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  658. } | column -s $'\t' -t
  659. }
  660. fn_info_message_seriousengine35(){
  661. echo -e "netstat -atunp | grep Sam3_Dedicate"
  662. echo -e ""
  663. {
  664. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  665. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp"
  666. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  667. } | column -s $'\t' -t
  668. }
  669. fn_info_message_sdtd(){
  670. fn_info_message_password_strip
  671. echo -e "netstat -atunp | grep 7DaysToDie"
  672. echo -e ""
  673. {
  674. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  675. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  676. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  677. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  678. echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
  679. } | column -s $'\t' -t
  680. echo -e ""
  681. echo -e "${lightgreen}${servername} WebAdmin${default}"
  682. fn_messages_separator
  683. {
  684. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  685. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  686. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  687. } | column -s $'\t' -t
  688. echo -e ""
  689. echo -e "${lightgreen}${servername} Telnet${default}"
  690. fn_messages_separator
  691. {
  692. echo -e "${blue}Telnet enabled:\t${default}${telnetenabled}"
  693. echo -e "${blue}Telnet address:\t${default}${ip} ${telnetport}"
  694. echo -e "${blue}Telnet password:\t${default}${telnetpass}"
  695. } | column -s $'\t' -t
  696. }
  697. fn_info_message_source(){
  698. echo -e "netstat -atunp | grep srcds_linux"
  699. echo -e ""
  700. {
  701. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  702. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  703. echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp"
  704. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  705. } | column -s $'\t' -t
  706. }
  707. fn_info_message_spark(){
  708. fn_info_message_password_strip
  709. echo -e "netstat -atunp | grep server_linux"
  710. echo -e ""
  711. {
  712. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  713. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  714. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  715. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  716. } | column -s $'\t' -t
  717. echo -e ""
  718. echo -e "${lightgreen}${servername} WebAdmin${default}"
  719. fn_messages_separator
  720. {
  721. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}/index.html"
  722. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  723. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  724. } | column -s $'\t' -t
  725. }
  726. fn_info_message_squad(){
  727. echo -e "netstat -atunp | grep SquadServer"
  728. echo -e ""
  729. {
  730. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  731. echo -e "> Game\tINBOUND\t${port}\tudp"
  732. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  733. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  734. } | column -s $'\t' -t
  735. }
  736. fn_info_message_starbound(){
  737. echo -e "netstat -atunp | grep starbound"
  738. echo -e ""
  739. {
  740. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  741. echo -e "> Game\tINBOUND\t${port}\ttcp"
  742. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  743. echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
  744. } | column -s $'\t' -t
  745. }
  746. fn_info_message_stationeers(){
  747. echo -e "netstat -atunp | grep rocketstation"
  748. echo -e ""
  749. {
  750. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  751. echo -e "> Game\tINBOUND\t${port}\ttcp"
  752. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  753. } | column -s $'\t' -t
  754. }
  755. fn_info_message_teamspeak3(){
  756. echo -e "netstat -atunp | grep ts3server"
  757. echo -e ""
  758. {
  759. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  760. echo -e "> Voice\tINBOUND\t${port}\tudp"
  761. echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp"
  762. echo -e "> File transfer\tINBOUND\t${fileport}\ttcp"
  763. } | column -s $'\t' -t
  764. }
  765. fn_info_message_teeworlds(){
  766. echo -e "netstat -atunp | grep teeworlds_srv"
  767. echo -e ""
  768. {
  769. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  770. echo -e "> Game\tINBOUND\t${port}\ttcp"
  771. } | column -s $'\t' -t
  772. }
  773. fn_info_message_terraria(){
  774. echo -e "netstat -atunp | grep TerrariaServer"
  775. echo -e ""
  776. {
  777. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  778. echo -e "> Game\tINBOUND\t${port}\ttcp"
  779. } | column -s $'\t' -t
  780. }
  781. fn_info_message_towerunite(){
  782. echo -e "netstat -atunp | grep TowerServer"
  783. echo -e ""
  784. {
  785. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  786. echo -e "> Game\tINBOUND\t${port}\ttcp"
  787. # Don't do arithmetics if ever the port wasn't a numeric value
  788. if [ "${port}" -eq "${port}" ]; then
  789. echo -e "> Steam\tINBOUND\t$((port+1))\tudp"
  790. fi
  791. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  792. } | column -s $'\t' -t
  793. }
  794. fn_info_message_unreal(){
  795. fn_info_message_password_strip
  796. echo -e "netstat -atunp | grep ucc-bin"
  797. echo -e ""
  798. {
  799. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  800. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  801. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  802. if [ "${engine}" == "unreal" ]; then
  803. echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp"
  804. fi
  805. if [ "${engine}" != "unreal" ] && [ "${appid}" != "223250" ]; then
  806. echo -e "> GameSpy query\tINBOUND\t${gsqueryport}\tudp\tOldQueryPortNumber=${gsqueryport}"
  807. fi
  808. if [ "${appid}" == "215360" ]; then
  809. echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp"
  810. else
  811. echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp"
  812. fi
  813. if [ "${appid}" ]; then
  814. if [ "${appid}" == "223250" ]; then
  815. echo -e "< Steam\tINBOUND\t20610\tudp"
  816. else
  817. echo -e "< Steam\tINBOUND\t20660\tudp"
  818. fi
  819. fi
  820. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  821. } | column -s $'\t' -t
  822. echo -e ""
  823. echo -e "${lightgreen}${servername} WebAdmin${default}"
  824. fn_messages_separator
  825. {
  826. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  827. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  828. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  829. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  830. } | column -s $'\t' -t
  831. }
  832. fn_info_message_unreal3(){
  833. echo -e "netstat -atunp | grep ut3-bin"
  834. echo -e ""
  835. {
  836. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  837. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  838. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  839. } | column -s $'\t' -t
  840. echo -e ""
  841. echo -e "${lightgreen}${servername} WebAdmin${default}"
  842. fn_messages_separator
  843. {
  844. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  845. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  846. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  847. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  848. } | column -s $'\t' -t
  849. }
  850. fn_info_message_kf2(){
  851. echo -e "netstat -atunp | grep KFGame"
  852. echo -e ""
  853. {
  854. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  855. echo -e "> Game\tINBOUND\t${port}\ttcp"
  856. echo -e "> Query\tINBOUND\t${queryport}\ttcp/udp"
  857. echo -e "> Steam\tINBOUND\t20560\tudp"
  858. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  859. } | column -s $'\t' -t
  860. echo -e ""
  861. echo -e "${lightgreen}${servername} WebAdmin${default}"
  862. fn_messages_separator
  863. {
  864. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  865. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  866. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  867. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  868. } | column -s $'\t' -t
  869. }
  870. fn_info_message_wolfensteinenemyterritory(){
  871. echo -e "netstat -atunp | grep etded"
  872. echo -e ""
  873. {
  874. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  875. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  876. } | column -s $'\t' -t
  877. }
  878. fn_info_message_mta(){
  879. echo -e "netstat -atunp | grep mta-server64"
  880. echo -e ""
  881. {
  882. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  883. echo -e "> Game\tOUTBOUND\t${port}\tudp"
  884. echo -e "> HTTP Server\tINBOUND\t${httpport}\ttcp"
  885. if [ "${ase}" == "Enabled" ]; then
  886. echo -e "> ASE Game_Monitor\tOUTBOUND\t$((${port} + 123))\tudp"
  887. fi
  888. } | column -s $'\t' -t
  889. }
  890. fn_info_message_select_engine(){
  891. # Display details depending on game or engine.
  892. if [ "${gamename}" == "7 Days To Die" ]; then
  893. fn_info_message_sdtd
  894. elif [ "${gamename}" == "ARK: Survival Evolved" ]; then
  895. fn_info_message_ark
  896. elif [ "${gamename}" == "Ballistic Overkill" ]; then
  897. fn_info_message_ballisticoverkill
  898. elif [ "${gamename}" == "Call of Duty" ]; then
  899. fn_info_message_cod
  900. elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then
  901. fn_info_message_coduo
  902. elif [ "${gamename}" == "Call of Duty 2" ]; then
  903. fn_info_message_cod2
  904. elif [ "${gamename}" == "Call of Duty 4" ]; then
  905. fn_info_message_cod4
  906. elif [ "${gamename}" == "Call of Duty: World at War" ]; then
  907. fn_info_message_codwaw
  908. elif [ "${gamename}" == "Factorio" ]; then
  909. fn_info_message_factorio
  910. elif [ "${gamename}" == "Hurtworld" ]; then
  911. fn_info_message_hurtworld
  912. elif [ "${gamename}" == "Just Cause 2" ]; then
  913. fn_info_message_justcause2
  914. elif [ "${gamename}" == "Just Cause 3" ]; then
  915. fn_info_message_justcause3
  916. elif [ "${shortname}" == "kf2" ]; then
  917. fn_info_message_kf2
  918. elif [ "${gamename}" == "Project Cars" ]; then
  919. fn_info_message_projectcars
  920. elif [ "${gamename}" == "QuakeWorld" ]; then
  921. fn_info_message_quake
  922. elif [ "${gamename}" == "Quake 2" ]; then
  923. fn_info_message_quake2
  924. elif [ "${gamename}" == "Quake 3: Arena" ]; then
  925. fn_info_message_quake3
  926. elif [ "${gamename}" == "Quake Live" ]; then
  927. fn_info_message_quakelive
  928. elif [ "${gamename}" == "San Andreas Multiplayer" ]; then
  929. fn_info_message_samp
  930. elif [ "${gamename}" == "Squad" ]; then
  931. fn_info_message_squad
  932. elif [ "${gamename}" == "Stationeers" ]; then
  933. fn_info_message_stationeers
  934. elif [ "${gamename}" == "TeamSpeak 3" ]; then
  935. fn_info_message_teamspeak3
  936. elif [ "${gamename}" == "Tower Unite" ]; then
  937. fn_info_message_towerunite
  938. elif [ "${gamename}" == "Multi Theft Auto" ]; then
  939. fn_info_message_mta
  940. elif [ "${gamename}" == "Mumble" ]; then
  941. fn_info_message_mumble
  942. elif [ "${gamename}" == "Rust" ]; then
  943. fn_info_message_rust
  944. elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
  945. fn_info_message_wolfensteinenemyterritory
  946. elif [ "${engine}" == "refractor" ]; then
  947. fn_info_message_refractor
  948. elif [ "${engine}" == "dontstarve" ]; then
  949. fn_info_message_dontstarve
  950. elif [ "${engine}" == "goldsource" ]; then
  951. fn_info_message_goldsource
  952. elif [ "${engine}" == "lwjgl2" ]; then
  953. fn_info_message_minecraft
  954. elif [ "${engine}" == "projectzomboid" ]; then
  955. fn_info_message_projectzomboid
  956. elif [ "${engine}" == "realvirtuality" ]; then
  957. fn_info_message_realvirtuality
  958. elif [ "${engine}" == "seriousengine35" ]; then
  959. fn_info_message_seriousengine35
  960. elif [ "${engine}" == "source" ]; then
  961. fn_info_message_source
  962. elif [ "${engine}" == "spark" ]; then
  963. fn_info_message_spark
  964. elif [ "${engine}" == "starbound" ]; then
  965. fn_info_message_starbound
  966. elif [ "${engine}" == "teeworlds" ]; then
  967. fn_info_message_teeworlds
  968. elif [ "${engine}" == "terraria" ]; then
  969. fn_info_message_terraria
  970. elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
  971. fn_info_message_unreal
  972. elif [ "${engine}" == "unreal3" ]; then
  973. fn_info_message_unreal3
  974. else
  975. fn_print_error_nl "Unable to detect server engine."
  976. fi
  977. }
  978. # Separator is different for details
  979. fn_messages_separator(){
  980. if [ "${function_selfname}" == "command_details.sh" ]; then
  981. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  982. else
  983. echo -e "================================="
  984. fi
  985. }
  986. # Removes the passwords form all but details
  987. fn_info_message_password_strip(){
  988. if [ "${function_selfname}" != "command_details.sh" ]; then
  989. if [ -n "${serverpassword}" ]; then
  990. serverpassword="********"
  991. fi
  992. if [ -n "${rconpassword}" ]; then
  993. rconpassword="********"
  994. fi
  995. if [ -n "${adminpassword}" ]; then
  996. adminpassword="********"
  997. fi
  998. if [ -n "${statspassword}" ]; then
  999. statspassword="********"
  1000. fi
  1001. if [ -n "${webadminpass}" ]; then
  1002. webadminpass="********"
  1003. fi
  1004. if [ -n "${telnetpass}" ]; then
  1005. telnetpass="********"
  1006. fi
  1007. fi
  1008. }