info_messages.sh 35 KB

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