info_messages.sh 36 KB

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