info_messages.sh 33 KB

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