info_messages.sh 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135
  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, 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_battalion1944(){
  449. echo -e "netstat -atunp | grep BattalionServ"
  450. echo -e ""
  451. {
  452. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  453. echo -e "> Game\tINBOUND\t${port}\tudp"
  454. # Don't do arithmetics if ever the port wasn't a numeric value
  455. # unconfirmed - http://wiki.battaliongame.com/Community_Servers#Firewalls_.2F_Port_Forwarding
  456. if [ "${port}" -eq "${port}" ]; then
  457. echo -e "> Steam\tINBOUND\t$((port+1))\tudp"
  458. echo -e "> Unused\tINBOUND\t$((port+2))\ttcp"
  459. fi
  460. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  461. } | column -s $'\t' -t
  462. }
  463. fn_info_message_cod(){
  464. echo -e "netstat -atunp | grep cod_lnxded"
  465. echo -e ""
  466. {
  467. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  468. echo -e "> Game\tINBOUND\t${port}\tudp"
  469. } | column -s $'\t' -t
  470. }
  471. fn_info_message_coduo(){
  472. echo -e "netstat -atunp | grep coduo_lnxded"
  473. echo -e ""
  474. {
  475. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  476. echo -e "> Game\tINBOUND\t${port}\tudp"
  477. } | column -s $'\t' -t
  478. }
  479. fn_info_message_cod2(){
  480. echo -e "netstat -atunp | grep cod2_lnxded"
  481. echo -e ""
  482. {
  483. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  484. echo -e "> Game\tINBOUND\t${port}\tudp"
  485. } | column -s $'\t' -t
  486. }
  487. fn_info_message_cod4(){
  488. echo -e "netstat -atunp"
  489. echo -e ""
  490. {
  491. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  492. echo -e "> Game\tINBOUND\t${port}\tudp"
  493. } | column -s $'\t' -t
  494. }
  495. fn_info_message_codwaw(){
  496. echo -e "netstat -atunp | grep codwaw_lnxded"
  497. echo -e ""
  498. {
  499. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  500. echo -e "> Game\tINBOUND\t${port}\tudp"
  501. } | column -s $'\t' -t
  502. }
  503. fn_info_message_dontstarve(){
  504. echo -e "netstat -atunp | grep dontstarve"
  505. echo -e ""
  506. {
  507. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  508. echo -e "> Game: Server\tINBOUND\t${port}\tudp"
  509. echo -e "> Game: Master\tINBOUND\t${masterport}\tudp"
  510. echo -e "> Steam: Auth\tINBOUND\t${steamauthenticationport}\tudp"
  511. echo -e "> Steam: Master\tINBOUND\t${steammasterserverport}\tudp"
  512. } | column -s $'\t' -t
  513. }
  514. fn_info_message_factorio(){
  515. echo -e "netstat -atunp | grep factorio"
  516. echo -e ""
  517. {
  518. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  519. echo -e "> Game\tINBOUND\t${port}\ttcp"
  520. } | column -s $'\t' -t
  521. }
  522. fn_info_message_goldsource(){
  523. echo -e "netstat -atunp | grep hlds_linux"
  524. echo -e ""
  525. {
  526. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  527. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  528. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  529. } | column -s $'\t' -t
  530. }
  531. fn_info_message_hurtworld(){
  532. echo -e "netstat -atunp | grep Hurtworld"
  533. echo -e ""
  534. {
  535. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  536. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  537. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  538. } | column -s $'\t' -t
  539. }
  540. fn_info_message_justcause2(){
  541. echo -e "netstat -atunp | grep Jcmp-Server"
  542. echo -e ""
  543. {
  544. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  545. echo -e "> Game\tINBOUND\t${port}\tudp"
  546. } | column -s $'\t' -t
  547. }
  548. fn_info_message_justcause3(){
  549. echo -e "netstat -atunp | grep Server"
  550. echo -e ""
  551. {
  552. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  553. echo -e "> Game\tINBOUND\t${port}\tudp"
  554. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  555. echo -e "> Steam\tINBOUND\t${steamport}\tudp"
  556. } | column -s $'\t' -t
  557. }
  558. fn_info_message_minecraft(){
  559. echo -e "netstat -atunp | grep java"
  560. echo -e ""
  561. {
  562. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  563. echo -e "> Game\tINBOUND\t${port}\ttcp"
  564. } | column -s $'\t' -t
  565. }
  566. fn_info_message_mumble(){
  567. echo -e "netstat -atunp | grep murmur"
  568. echo -e ""
  569. {
  570. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  571. echo -e "> Voice\tINBOUND\t${port}\tudp"
  572. echo -e "> ServerQuery\tINBOUND\t${port}\ttcp"
  573. } | column -s $'\t' -t
  574. }
  575. fn_info_message_projectcars(){
  576. echo -e "netstat -atunp | grep DedicatedS"
  577. echo -e ""
  578. {
  579. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  580. echo -e "> Game\tINBOUND\t${port}\tudp"
  581. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  582. echo -e "> Steam\tINBOUND\t${steamport}\tudp"
  583. } | column -s $'\t' -t
  584. }
  585. fn_info_message_projectzomboid(){
  586. echo -e "netstat -atunp | grep java"
  587. echo -e ""
  588. {
  589. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  590. echo -e "> Game\tINBOUND\t${port}\tudp"
  591. } | column -s $'\t' -t
  592. }
  593. fn_info_message_quake(){
  594. echo -e "netstat -atunp | grep mvdsv"
  595. echo -e ""
  596. {
  597. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  598. echo -e "> Game\tINBOUND\t${port}\tudp"
  599. } | column -s $'\t' -t
  600. }
  601. fn_info_message_quake2(){
  602. echo -e "netstat -atunp | grep quake2"
  603. echo -e ""
  604. {
  605. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  606. echo -e "> Game\tINBOUND\t${port}\tudp"
  607. } | column -s $'\t' -t
  608. }
  609. fn_info_message_quake3(){
  610. echo -e "netstat -atunp | grep q3ded"
  611. echo -e ""
  612. {
  613. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  614. echo -e "> Game\tINBOUND\t${port}\tudp"
  615. } | column -s $'\t' -t
  616. }
  617. fn_info_message_quakelive(){
  618. echo -e "netstat -atunp | grep qzeroded"
  619. echo -e ""
  620. if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then
  621. echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}."
  622. echo -e ""
  623. fi
  624. {
  625. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  626. echo -e "> Game\tINBOUND\t${port}\tudp"
  627. echo -e "> Rcon\tINBOUND\t${rconport}\tudp"
  628. echo -e "> Stats\tINBOUND\t${statsport}\tudp"
  629. } | column -s $'\t' -t
  630. }
  631. fn_info_message_realvirtuality(){
  632. echo -e "netstat -atunp | grep arma3server"
  633. echo -e ""
  634. # Default port
  635. if [ -z "${port}" ]; then
  636. port="2302"
  637. fi
  638. {
  639. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  640. echo -e "> Game\tINBOUND\t${port}\tudp"
  641. # Don't do arithmetics if ever the port wasn't a numeric value
  642. if [ "${port}" -eq "${port}" ]; then
  643. echo -e "> Steam: Query\tINBOUND\t$((port+1))\tudp"
  644. echo -e "> Steam: Master traffic\tINBOUND\t$((port+2))\tudp"
  645. echo -e "> Undocumented Port\tINBOUND\t$((port+3))\tudp"
  646. fi
  647. } | column -s $'\t' -t
  648. }
  649. fn_info_message_refractor(){
  650. echo -e "netstat -atunp | grep bf1942_lnxd"
  651. echo -e ""
  652. {
  653. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  654. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  655. echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp"
  656. } | column -s $'\t' -t
  657. }
  658. fn_info_message_rust(){
  659. echo -e "netstat -atunp | grep Rust"
  660. echo -e ""
  661. {
  662. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  663. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  664. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  665. } | column -s $'\t' -t
  666. }
  667. fn_info_message_samp(){
  668. echo -e "netstat -atunp | grep samp03svr"
  669. echo -e ""
  670. {
  671. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  672. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  673. } | column -s $'\t' -t
  674. }
  675. fn_info_message_seriousengine35(){
  676. echo -e "netstat -atunp | grep Sam3_Dedicate"
  677. echo -e ""
  678. {
  679. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  680. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp"
  681. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  682. } | column -s $'\t' -t
  683. }
  684. fn_info_message_sdtd(){
  685. fn_info_message_password_strip
  686. echo -e "netstat -atunp | grep 7DaysToDie"
  687. echo -e ""
  688. {
  689. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  690. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  691. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  692. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  693. echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
  694. } | column -s $'\t' -t
  695. echo -e ""
  696. echo -e "${lightgreen}${servername} WebAdmin${default}"
  697. fn_messages_separator
  698. {
  699. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  700. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  701. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  702. } | column -s $'\t' -t
  703. echo -e ""
  704. echo -e "${lightgreen}${servername} Telnet${default}"
  705. fn_messages_separator
  706. {
  707. echo -e "${blue}Telnet enabled:\t${default}${telnetenabled}"
  708. echo -e "${blue}Telnet address:\t${default}${ip} ${telnetport}"
  709. echo -e "${blue}Telnet password:\t${default}${telnetpass}"
  710. } | column -s $'\t' -t
  711. }
  712. fn_info_message_source(){
  713. echo -e "netstat -atunp | grep srcds_linux"
  714. echo -e ""
  715. {
  716. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  717. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  718. echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp"
  719. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  720. } | column -s $'\t' -t
  721. }
  722. fn_info_message_spark(){
  723. fn_info_message_password_strip
  724. echo -e "netstat -atunp | grep server_linux"
  725. echo -e ""
  726. {
  727. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  728. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  729. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  730. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  731. } | column -s $'\t' -t
  732. echo -e ""
  733. echo -e "${lightgreen}${servername} WebAdmin${default}"
  734. fn_messages_separator
  735. {
  736. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}/index.html"
  737. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  738. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  739. } | column -s $'\t' -t
  740. }
  741. fn_info_message_squad(){
  742. echo -e "netstat -atunp | grep SquadServer"
  743. echo -e ""
  744. {
  745. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  746. echo -e "> Game\tINBOUND\t${port}\tudp"
  747. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  748. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  749. } | column -s $'\t' -t
  750. }
  751. fn_info_message_starbound(){
  752. echo -e "netstat -atunp | grep starbound"
  753. echo -e ""
  754. {
  755. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  756. echo -e "> Game\tINBOUND\t${port}\ttcp"
  757. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  758. echo -e "> Rcon\tINBOUND\t${rconport}\ttcp"
  759. } | column -s $'\t' -t
  760. }
  761. fn_info_message_stationeers(){
  762. echo -e "netstat -atunp | grep rocketstation"
  763. echo -e ""
  764. {
  765. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  766. echo -e "> Game\tINBOUND\t${port}\ttcp"
  767. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  768. } | column -s $'\t' -t
  769. }
  770. fn_info_message_teamspeak3(){
  771. echo -e "netstat -atunp | grep ts3server"
  772. echo -e ""
  773. {
  774. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  775. echo -e "> Voice\tINBOUND\t${port}\tudp"
  776. echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp"
  777. echo -e "> File transfer\tINBOUND\t${fileport}\ttcp"
  778. } | column -s $'\t' -t
  779. }
  780. fn_info_message_teeworlds(){
  781. echo -e "netstat -atunp | grep teeworlds_srv"
  782. echo -e ""
  783. {
  784. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  785. echo -e "> Game\tINBOUND\t${port}\ttcp"
  786. } | column -s $'\t' -t
  787. }
  788. fn_info_message_terraria(){
  789. echo -e "netstat -atunp | grep TerrariaServer"
  790. echo -e ""
  791. {
  792. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  793. echo -e "> Game\tINBOUND\t${port}\ttcp"
  794. } | column -s $'\t' -t
  795. }
  796. fn_info_message_towerunite(){
  797. echo -e "netstat -atunp | grep TowerServer"
  798. echo -e ""
  799. {
  800. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  801. echo -e "> Game\tINBOUND\t${port}\ttcp"
  802. # Don't do arithmetics if ever the port wasn't a numeric value
  803. if [ "${port}" -eq "${port}" ]; then
  804. echo -e "> Steam\tINBOUND\t$((port+1))\tudp"
  805. fi
  806. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  807. } | column -s $'\t' -t
  808. }
  809. fn_info_message_unreal(){
  810. fn_info_message_password_strip
  811. echo -e "netstat -atunp | grep ucc-bin"
  812. echo -e ""
  813. {
  814. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  815. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  816. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  817. if [ "${engine}" == "unreal" ]; then
  818. echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp"
  819. fi
  820. if [ "${engine}" != "unreal" ] && [ "${appid}" != "223250" ]; then
  821. echo -e "> GameSpy query\tINBOUND\t${gsqueryport}\tudp\tOldQueryPortNumber=${gsqueryport}"
  822. fi
  823. if [ "${appid}" == "215360" ]; then
  824. echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp"
  825. else
  826. echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp"
  827. fi
  828. if [ "${appid}" ]; then
  829. if [ "${appid}" == "223250" ]; then
  830. echo -e "< Steam\tINBOUND\t20610\tudp"
  831. else
  832. echo -e "< Steam\tINBOUND\t20660\tudp"
  833. fi
  834. fi
  835. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  836. } | column -s $'\t' -t
  837. echo -e ""
  838. echo -e "${lightgreen}${servername} WebAdmin${default}"
  839. fn_messages_separator
  840. {
  841. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  842. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  843. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  844. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  845. } | column -s $'\t' -t
  846. }
  847. fn_info_message_unreal3(){
  848. echo -e "netstat -atunp | grep ut3-bin"
  849. echo -e ""
  850. {
  851. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  852. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  853. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  854. } | column -s $'\t' -t
  855. echo -e ""
  856. echo -e "${lightgreen}${servername} WebAdmin${default}"
  857. fn_messages_separator
  858. {
  859. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  860. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  861. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  862. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  863. } | column -s $'\t' -t
  864. }
  865. fn_info_message_kf2(){
  866. echo -e "netstat -atunp | grep KFGame"
  867. echo -e ""
  868. {
  869. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  870. echo -e "> Game\tINBOUND\t${port}\ttcp"
  871. echo -e "> Query\tINBOUND\t${queryport}\ttcp/udp"
  872. echo -e "> Steam\tINBOUND\t20560\tudp"
  873. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  874. } | column -s $'\t' -t
  875. echo -e ""
  876. echo -e "${lightgreen}${servername} WebAdmin${default}"
  877. fn_messages_separator
  878. {
  879. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  880. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  881. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  882. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  883. } | column -s $'\t' -t
  884. }
  885. fn_info_message_wolfensteinenemyterritory(){
  886. echo -e "netstat -atunp | grep etded"
  887. echo -e ""
  888. {
  889. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  890. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  891. } | column -s $'\t' -t
  892. }
  893. fn_info_message_mta(){
  894. echo -e "netstat -atunp | grep mta-server64"
  895. echo -e ""
  896. {
  897. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  898. echo -e "> Game\tOUTBOUND\t${port}\tudp"
  899. echo -e "> HTTP Server\tINBOUND\t${httpport}\ttcp"
  900. if [ "${ase}" == "Enabled" ]; then
  901. echo -e "> ASE Game_Monitor\tOUTBOUND\t$((${port} + 123))\tudp"
  902. fi
  903. } | column -s $'\t' -t
  904. }
  905. fn_info_message_select_engine(){
  906. # Display details depending on game or engine.
  907. if [ "${gamename}" == "7 Days To Die" ]; then
  908. fn_info_message_sdtd
  909. elif [ "${gamename}" == "ARK: Survival Evolved" ]; then
  910. fn_info_message_ark
  911. elif [ "${gamename}" == "Ballistic Overkill" ]; then
  912. fn_info_message_ballisticoverkill
  913. elif [ "${gamename}" == "Battalion 1944" ]; then
  914. fn_info_message_battalion1944
  915. elif [ "${gamename}" == "Call of Duty" ]; then
  916. fn_info_message_cod
  917. elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then
  918. fn_info_message_coduo
  919. elif [ "${gamename}" == "Call of Duty 2" ]; then
  920. fn_info_message_cod2
  921. elif [ "${gamename}" == "Call of Duty 4" ]; then
  922. fn_info_message_cod4
  923. elif [ "${gamename}" == "Call of Duty: World at War" ]; then
  924. fn_info_message_codwaw
  925. elif [ "${gamename}" == "Factorio" ]; then
  926. fn_info_message_factorio
  927. elif [ "${gamename}" == "Hurtworld" ]; then
  928. fn_info_message_hurtworld
  929. elif [ "${gamename}" == "Just Cause 2" ]; then
  930. fn_info_message_justcause2
  931. elif [ "${gamename}" == "Just Cause 3" ]; then
  932. fn_info_message_justcause3
  933. elif [ "${shortname}" == "kf2" ]; then
  934. fn_info_message_kf2
  935. elif [ "${gamename}" == "Project Cars" ]; then
  936. fn_info_message_projectcars
  937. elif [ "${gamename}" == "QuakeWorld" ]; then
  938. fn_info_message_quake
  939. elif [ "${gamename}" == "Quake 2" ]; then
  940. fn_info_message_quake2
  941. elif [ "${gamename}" == "Quake 3: Arena" ]; then
  942. fn_info_message_quake3
  943. elif [ "${gamename}" == "Quake Live" ]; then
  944. fn_info_message_quakelive
  945. elif [ "${gamename}" == "San Andreas Multiplayer" ]; then
  946. fn_info_message_samp
  947. elif [ "${gamename}" == "Squad" ]; then
  948. fn_info_message_squad
  949. elif [ "${gamename}" == "Stationeers" ]; then
  950. fn_info_message_stationeers
  951. elif [ "${gamename}" == "TeamSpeak 3" ]; then
  952. fn_info_message_teamspeak3
  953. elif [ "${gamename}" == "Tower Unite" ]; then
  954. fn_info_message_towerunite
  955. elif [ "${gamename}" == "Multi Theft Auto" ]; then
  956. fn_info_message_mta
  957. elif [ "${gamename}" == "Mumble" ]; then
  958. fn_info_message_mumble
  959. elif [ "${gamename}" == "Rust" ]; then
  960. fn_info_message_rust
  961. elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
  962. fn_info_message_wolfensteinenemyterritory
  963. elif [ "${engine}" == "refractor" ]; then
  964. fn_info_message_refractor
  965. elif [ "${engine}" == "dontstarve" ]; then
  966. fn_info_message_dontstarve
  967. elif [ "${engine}" == "goldsource" ]; then
  968. fn_info_message_goldsource
  969. elif [ "${engine}" == "lwjgl2" ]; then
  970. fn_info_message_minecraft
  971. elif [ "${engine}" == "projectzomboid" ]; then
  972. fn_info_message_projectzomboid
  973. elif [ "${engine}" == "realvirtuality" ]; then
  974. fn_info_message_realvirtuality
  975. elif [ "${engine}" == "seriousengine35" ]; then
  976. fn_info_message_seriousengine35
  977. elif [ "${engine}" == "source" ]; then
  978. fn_info_message_source
  979. elif [ "${engine}" == "spark" ]; then
  980. fn_info_message_spark
  981. elif [ "${engine}" == "starbound" ]; then
  982. fn_info_message_starbound
  983. elif [ "${engine}" == "teeworlds" ]; then
  984. fn_info_message_teeworlds
  985. elif [ "${engine}" == "terraria" ]; then
  986. fn_info_message_terraria
  987. elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
  988. fn_info_message_unreal
  989. elif [ "${engine}" == "unreal3" ]; then
  990. fn_info_message_unreal3
  991. else
  992. fn_print_error_nl "Unable to detect server engine."
  993. fi
  994. }
  995. # Separator is different for details
  996. fn_messages_separator(){
  997. if [ "${function_selfname}" == "command_details.sh" ]; then
  998. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  999. else
  1000. echo -e "================================="
  1001. fi
  1002. }
  1003. # Removes the passwords form all but details
  1004. fn_info_message_password_strip(){
  1005. if [ "${function_selfname}" != "command_details.sh" ]; then
  1006. if [ -n "${serverpassword}" ]; then
  1007. serverpassword="********"
  1008. fi
  1009. if [ -n "${rconpassword}" ]; then
  1010. rconpassword="********"
  1011. fi
  1012. if [ -n "${adminpassword}" ]; then
  1013. adminpassword="********"
  1014. fi
  1015. if [ -n "${statspassword}" ]; then
  1016. statspassword="********"
  1017. fi
  1018. if [ -n "${webadminpass}" ]; then
  1019. webadminpass="********"
  1020. fi
  1021. if [ -n "${telnetpass}" ]; then
  1022. telnetpass="********"
  1023. fi
  1024. fi
  1025. }