4
0

info_messages.sh 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217
  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\t available${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)
  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" "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" )
  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_eco(){
  543. echo -e "netstat -atunp | grep mono"
  544. echo -e ""
  545. {
  546. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  547. echo -e "> Game\tINBOUND\t${port}\tudp"
  548. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  549. } | column -s $'\t' -t
  550. }
  551. fn_info_message_factorio(){
  552. echo -e "netstat -atunp | grep factorio"
  553. echo -e ""
  554. {
  555. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  556. echo -e "> Game\tINBOUND\t${port}\ttcp"
  557. } | column -s $'\t' -t
  558. }
  559. fn_info_message_goldsource(){
  560. echo -e "netstat -atunp | grep hlds_linux"
  561. echo -e ""
  562. {
  563. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  564. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  565. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  566. } | column -s $'\t' -t
  567. }
  568. fn_info_message_hurtworld(){
  569. echo -e "netstat -atunp | grep Hurtworld"
  570. echo -e ""
  571. {
  572. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  573. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  574. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  575. } | column -s $'\t' -t
  576. }
  577. fn_info_message_justcause2(){
  578. echo -e "netstat -atunp | grep Jcmp-Server"
  579. echo -e ""
  580. {
  581. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  582. echo -e "> Game\tINBOUND\t${port}\tudp"
  583. } | column -s $'\t' -t
  584. }
  585. fn_info_message_justcause3(){
  586. echo -e "netstat -atunp | grep Server"
  587. echo -e ""
  588. {
  589. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  590. echo -e "> Game\tINBOUND\t${port}\tudp"
  591. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  592. echo -e "> Steam\tINBOUND\t${steamport}\tudp"
  593. } | column -s $'\t' -t
  594. }
  595. fn_info_message_minecraft(){
  596. echo -e "netstat -atunp | grep java"
  597. echo -e ""
  598. {
  599. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  600. echo -e "> Game\tINBOUND\t${port}\ttcp"
  601. } | column -s $'\t' -t
  602. }
  603. fn_info_message_mumble(){
  604. echo -e "netstat -atunp | grep murmur"
  605. echo -e ""
  606. {
  607. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  608. echo -e "> Voice\tINBOUND\t${port}\tudp"
  609. echo -e "> ServerQuery\tINBOUND\t${port}\ttcp"
  610. } | column -s $'\t' -t
  611. }
  612. fn_info_message_projectcars(){
  613. echo -e "netstat -atunp | grep DedicatedS"
  614. echo -e ""
  615. {
  616. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  617. echo -e "> Game\tINBOUND\t${port}\tudp"
  618. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  619. echo -e "> Steam\tINBOUND\t${steamport}\tudp"
  620. } | column -s $'\t' -t
  621. }
  622. fn_info_message_projectzomboid(){
  623. echo -e "netstat -atunp | grep java"
  624. echo -e ""
  625. {
  626. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  627. echo -e "> Game\tINBOUND\t${port}\tudp"
  628. } | column -s $'\t' -t
  629. }
  630. fn_info_message_quake(){
  631. echo -e "netstat -atunp | grep mvdsv"
  632. echo -e ""
  633. {
  634. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  635. echo -e "> Game\tINBOUND\t${port}\tudp"
  636. } | column -s $'\t' -t
  637. }
  638. fn_info_message_quake2(){
  639. echo -e "netstat -atunp | grep quake2"
  640. echo -e ""
  641. {
  642. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  643. echo -e "> Game\tINBOUND\t${port}\tudp"
  644. } | column -s $'\t' -t
  645. }
  646. fn_info_message_quake3(){
  647. echo -e "netstat -atunp | grep q3ded"
  648. echo -e ""
  649. {
  650. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  651. echo -e "> Game\tINBOUND\t${port}\tudp"
  652. } | column -s $'\t' -t
  653. }
  654. fn_info_message_quakelive(){
  655. echo -e "netstat -atunp | grep qzeroded"
  656. echo -e ""
  657. if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then
  658. echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}."
  659. echo -e ""
  660. fi
  661. {
  662. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  663. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  664. echo -e "> Rcon\tINBOUND\t${rconport}\tudp"
  665. echo -e "> Stats\tINBOUND\t${statsport}\tudp"
  666. } | column -s $'\t' -t
  667. }
  668. fn_info_message_realvirtuality(){
  669. echo -e "netstat -atunp | grep arma3server"
  670. echo -e ""
  671. # Default port
  672. if [ -z "${port}" ]; then
  673. port="2302"
  674. fi
  675. {
  676. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  677. echo -e "> Game\tINBOUND\t${port}\tudp"
  678. # Don't do arithmetics if ever the port wasn't a numeric value
  679. if [ "${port}" -eq "${port}" ]; then
  680. echo -e "> Steam: Query\tINBOUND\t$((port+1))\tudp"
  681. echo -e "> Steam: Master traffic\tINBOUND\t$((port+2))\tudp"
  682. echo -e "> Undocumented Port\tINBOUND\t$((port+3))\tudp"
  683. fi
  684. } | column -s $'\t' -t
  685. }
  686. fn_info_message_refractor(){
  687. echo -e "netstat -atunp | grep bf1942_lnxd"
  688. echo -e ""
  689. {
  690. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  691. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  692. echo -e "> Steam: Query\tINBOUND\t${queryport}\tudp"
  693. } | column -s $'\t' -t
  694. }
  695. fn_info_message_risingworld(){
  696. echo -e "netstat -atunp | grep java"
  697. echo -e ""
  698. {
  699. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  700. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  701. echo -e "> http query\tINBOUND\t${httpqueryport}\ttcp"
  702. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  703. } | column -s $'\t' -t
  704. }
  705. fn_info_message_rust(){
  706. echo -e "netstat -atunp | grep Rust"
  707. echo -e ""
  708. {
  709. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  710. echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp"
  711. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  712. } | column -s $'\t' -t
  713. }
  714. fn_info_message_samp(){
  715. echo -e "netstat -atunp | grep samp03svr"
  716. echo -e ""
  717. {
  718. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  719. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  720. } | column -s $'\t' -t
  721. }
  722. fn_info_message_seriousengine35(){
  723. echo -e "netstat -atunp | grep Sam3_Dedicate"
  724. echo -e ""
  725. {
  726. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  727. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp"
  728. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  729. } | column -s $'\t' -t
  730. }
  731. fn_info_message_sdtd(){
  732. fn_info_message_password_strip
  733. echo -e "netstat -atunp | grep 7DaysToDie"
  734. echo -e ""
  735. {
  736. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  737. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  738. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  739. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  740. echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp"
  741. } | column -s $'\t' -t
  742. echo -e ""
  743. echo -e "${lightgreen}${servername} WebAdmin${default}"
  744. fn_messages_separator
  745. {
  746. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  747. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  748. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  749. } | column -s $'\t' -t
  750. echo -e ""
  751. echo -e "${lightgreen}${servername} Telnet${default}"
  752. fn_messages_separator
  753. {
  754. echo -e "${blue}Telnet enabled:\t${default}${telnetenabled}"
  755. echo -e "${blue}Telnet address:\t${default}${ip} ${telnetport}"
  756. echo -e "${blue}Telnet password:\t${default}${telnetpass}"
  757. } | column -s $'\t' -t
  758. }
  759. fn_info_message_source(){
  760. echo -e "netstat -atunp | grep srcds_linux"
  761. echo -e ""
  762. {
  763. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  764. echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
  765. echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp"
  766. echo -e "< Client\tOUTBOUND\t${clientport}\tudp"
  767. } | column -s $'\t' -t
  768. }
  769. fn_info_message_spark(){
  770. fn_info_message_password_strip
  771. echo -e "netstat -atunp | grep server_linux"
  772. echo -e ""
  773. {
  774. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  775. echo -e "> Game/RCON\tINBOUND\t${port}\tudp"
  776. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  777. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp"
  778. } | column -s $'\t' -t
  779. echo -e ""
  780. echo -e "${lightgreen}${servername} WebAdmin${default}"
  781. fn_messages_separator
  782. {
  783. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}/index.html"
  784. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  785. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  786. } | column -s $'\t' -t
  787. }
  788. fn_info_message_squad(){
  789. echo -e "netstat -atunp | grep SquadServer"
  790. echo -e ""
  791. {
  792. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  793. echo -e "> Game\tINBOUND\t${port}\tudp"
  794. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  795. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  796. } | column -s $'\t' -t
  797. }
  798. fn_info_message_starbound(){
  799. echo -e "netstat -atunp | grep starbound"
  800. echo -e ""
  801. {
  802. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  803. echo -e "> Game\tINBOUND\t${port}\ttcp"
  804. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  805. echo -e "> RCON\tINBOUND\t${rconport}\ttcp"
  806. } | column -s $'\t' -t
  807. }
  808. fn_info_message_stationeers(){
  809. echo -e "netstat -atunp | grep rocketstation"
  810. echo -e ""
  811. {
  812. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  813. echo -e "> Game\tINBOUND\t${port}\ttcp"
  814. echo -e "> Query\tINBOUND\t${queryport}\ttcp"
  815. } | column -s $'\t' -t
  816. }
  817. fn_info_message_teamspeak3(){
  818. echo -e "netstat -atunp | grep ts3server"
  819. echo -e ""
  820. {
  821. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  822. echo -e "> Voice\tINBOUND\t${port}\tudp"
  823. echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp"
  824. echo -e "> File transfer\tINBOUND\t${fileport}\ttcp"
  825. } | column -s $'\t' -t
  826. }
  827. fn_info_message_teeworlds(){
  828. echo -e "netstat -atunp | grep teeworlds_srv"
  829. echo -e ""
  830. {
  831. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  832. echo -e "> Game\tINBOUND\t${port}\ttcp"
  833. } | column -s $'\t' -t
  834. }
  835. fn_info_message_terraria(){
  836. echo -e "netstat -atunp | grep TerrariaServer"
  837. echo -e ""
  838. {
  839. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  840. echo -e "> Game\tINBOUND\t${port}\ttcp"
  841. } | column -s $'\t' -t
  842. }
  843. fn_info_message_towerunite(){
  844. echo -e "netstat -atunp | grep TowerServer"
  845. echo -e ""
  846. {
  847. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  848. echo -e "> Game\tINBOUND\t${port}\ttcp"
  849. # Don't do arithmetics if ever the port wasn't a numeric value
  850. if [ "${port}" -eq "${port}" ]; then
  851. echo -e "> Steam\tINBOUND\t$((port+1))\tudp"
  852. fi
  853. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  854. } | column -s $'\t' -t
  855. }
  856. fn_info_message_unreal(){
  857. fn_info_message_password_strip
  858. echo -e "netstat -atunp | grep ucc-bin"
  859. echo -e ""
  860. {
  861. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
  862. echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}"
  863. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  864. if [ "${engine}" == "unreal" ]; then
  865. echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp"
  866. fi
  867. if [ "${engine}" != "unreal" ] && [ "${appid}" != "223250" ]; then
  868. echo -e "> GameSpy query\tINBOUND\t${gsqueryport}\tudp\tOldQueryPortNumber=${gsqueryport}"
  869. fi
  870. if [ "${appid}" == "215360" ]; then
  871. echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp"
  872. else
  873. echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp"
  874. fi
  875. if [ "${appid}" ]; then
  876. if [ "${appid}" == "223250" ]; then
  877. echo -e "< Steam\tINBOUND\t20610\tudp"
  878. else
  879. echo -e "< Steam\tINBOUND\t20660\tudp"
  880. fi
  881. fi
  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_unreal3(){
  895. echo -e "netstat -atunp | grep ut3-bin"
  896. echo -e ""
  897. {
  898. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  899. echo -e "> Game\tINBOUND\t${port}\tudp"
  900. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  901. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  902. } | column -s $'\t' -t
  903. echo -e ""
  904. echo -e "${lightgreen}${servername} WebAdmin${default}"
  905. fn_messages_separator
  906. {
  907. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  908. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  909. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  910. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  911. } | column -s $'\t' -t
  912. }
  913. fn_info_message_kf2(){
  914. echo -e "netstat -atunp | grep KFGame"
  915. echo -e ""
  916. {
  917. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  918. echo -e "> Game\tINBOUND\t${port}\ttcp\tPort=${port}"
  919. echo -e "> Query\tINBOUND\t${queryport}\tudp"
  920. echo -e "> Steam\tINBOUND\t20560\tudp"
  921. echo -e "> WebAdmin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}"
  922. } | column -s $'\t' -t
  923. echo -e ""
  924. echo -e "${lightgreen}${servername} WebAdmin${default}"
  925. fn_messages_separator
  926. {
  927. echo -e "${blue}WebAdmin enabled:\t${default}${webadminenabled}"
  928. echo -e "${blue}WebAdmin url:\t${default}http://${ip}:${webadminport}"
  929. echo -e "${blue}WebAdmin username:\t${default}${webadminuser}"
  930. echo -e "${blue}WebAdmin password:\t${default}${webadminpass}"
  931. } | column -s $'\t' -t
  932. }
  933. fn_info_message_wolfensteinenemyterritory(){
  934. echo -e "netstat -atunp | grep etded"
  935. echo -e ""
  936. {
  937. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  938. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  939. } | column -s $'\t' -t
  940. }
  941. fn_info_message_etlegacy(){
  942. echo -e "netstat -atunp | grep etlded"
  943. echo -e ""
  944. {
  945. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  946. echo -e "> Game/Query\tINBOUND\t${port}\tudp"
  947. } | column -s $'\t' -t
  948. }
  949. fn_info_message_mta(){
  950. echo -e "netstat -atunp | grep mta-server64"
  951. echo -e ""
  952. {
  953. echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
  954. echo -e "> Game\tOUTBOUND\t${port}\tudp"
  955. echo -e "> HTTP Server\tINBOUND\t${httpport}\ttcp"
  956. if [ "${ase}" == "Enabled" ]; then
  957. echo -e "> ASE Game_Monitor\tOUTBOUND\t$((${port} + 123))\tudp"
  958. fi
  959. } | column -s $'\t' -t
  960. }
  961. fn_info_message_select_engine(){
  962. # Display details depending on game or engine.
  963. if [ "${gamename}" == "7 Days To Die" ]; then
  964. fn_info_message_sdtd
  965. elif [ "${gamename}" == "ARK: Survival Evolved" ]; then
  966. fn_info_message_ark
  967. elif [ "${gamename}" == "Ballistic Overkill" ]; then
  968. fn_info_message_ballisticoverkill
  969. elif [ "${gamename}" == "Battalion 1944" ]; then
  970. fn_info_message_battalion1944
  971. elif [ "${gamename}" == "Call of Duty" ]; then
  972. fn_info_message_cod
  973. elif [ "${gamename}" == "Call of Duty: United Offensive" ]; then
  974. fn_info_message_coduo
  975. elif [ "${gamename}" == "Call of Duty 2" ]; then
  976. fn_info_message_cod2
  977. elif [ "${gamename}" == "Call of Duty 4" ]; then
  978. fn_info_message_cod4
  979. elif [ "${gamename}" == "Call of Duty: World at War" ]; then
  980. fn_info_message_codwaw
  981. elif [ "${gamename}" == "Eco" ]; then
  982. fn_info_message_eco
  983. elif [ "${gamename}" == "ET: Legacy" ]; then
  984. fn_info_message_etlegacy
  985. elif [ "${gamename}" == "Factorio" ]; then
  986. fn_info_message_factorio
  987. elif [ "${gamename}" == "Hurtworld" ]; then
  988. fn_info_message_hurtworld
  989. elif [ "${gamename}" == "Just Cause 2" ]; then
  990. fn_info_message_justcause2
  991. elif [ "${gamename}" == "Just Cause 3" ]; then
  992. fn_info_message_justcause3
  993. elif [ "${shortname}" == "kf2" ]; then
  994. fn_info_message_kf2
  995. elif [ "${gamename}" == "Project Cars" ]; then
  996. fn_info_message_projectcars
  997. elif [ "${gamename}" == "QuakeWorld" ]; then
  998. fn_info_message_quake
  999. elif [ "${gamename}" == "Quake 2" ]; then
  1000. fn_info_message_quake2
  1001. elif [ "${gamename}" == "Quake 3: Arena" ]; then
  1002. fn_info_message_quake3
  1003. elif [ "${gamename}" == "Quake Live" ]; then
  1004. fn_info_message_quakelive
  1005. elif [ "${gamename}" == "San Andreas Multiplayer" ]; then
  1006. fn_info_message_samp
  1007. elif [ "${gamename}" == "Squad" ]; then
  1008. fn_info_message_squad
  1009. elif [ "${gamename}" == "Stationeers" ]; then
  1010. fn_info_message_stationeers
  1011. elif [ "${gamename}" == "TeamSpeak 3" ]; then
  1012. fn_info_message_teamspeak3
  1013. elif [ "${gamename}" == "Tower Unite" ]; then
  1014. fn_info_message_towerunite
  1015. elif [ "${gamename}" == "Multi Theft Auto" ]; then
  1016. fn_info_message_mta
  1017. elif [ "${gamename}" == "Mumble" ]; then
  1018. fn_info_message_mumble
  1019. elif [ "${gamename}" == "Rust" ]; then
  1020. fn_info_message_rust
  1021. elif [ "${shortname}" == "rw" ]; then
  1022. fn_info_message_risingworld
  1023. elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
  1024. fn_info_message_wolfensteinenemyterritory
  1025. elif [ "${engine}" == "refractor" ]; then
  1026. fn_info_message_refractor
  1027. elif [ "${engine}" == "dontstarve" ]; then
  1028. fn_info_message_dontstarve
  1029. elif [ "${engine}" == "goldsource" ]; then
  1030. fn_info_message_goldsource
  1031. elif [ "${engine}" == "lwjgl2" ]; then
  1032. fn_info_message_minecraft
  1033. elif [ "${engine}" == "projectzomboid" ]; then
  1034. fn_info_message_projectzomboid
  1035. elif [ "${engine}" == "realvirtuality" ]; then
  1036. fn_info_message_realvirtuality
  1037. elif [ "${engine}" == "seriousengine35" ]; then
  1038. fn_info_message_seriousengine35
  1039. elif [ "${engine}" == "source" ]; then
  1040. fn_info_message_source
  1041. elif [ "${engine}" == "spark" ]; then
  1042. fn_info_message_spark
  1043. elif [ "${engine}" == "starbound" ]; then
  1044. fn_info_message_starbound
  1045. elif [ "${engine}" == "teeworlds" ]; then
  1046. fn_info_message_teeworlds
  1047. elif [ "${engine}" == "terraria" ]; then
  1048. fn_info_message_terraria
  1049. elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
  1050. fn_info_message_unreal
  1051. elif [ "${engine}" == "unreal3" ]; then
  1052. fn_info_message_unreal3
  1053. else
  1054. fn_print_error_nl "Unable to detect server engine."
  1055. fi
  1056. }
  1057. # Separator is different for details
  1058. fn_messages_separator(){
  1059. if [ "${function_selfname}" == "command_details.sh" ]; then
  1060. printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
  1061. else
  1062. echo -e "================================="
  1063. fi
  1064. }
  1065. # Removes the passwords form all but details
  1066. fn_info_message_password_strip(){
  1067. if [ "${function_selfname}" != "command_details.sh" ]; then
  1068. if [ -n "${serverpassword}" ]; then
  1069. serverpassword="********"
  1070. fi
  1071. if [ -n "${rconpassword}" ]; then
  1072. rconpassword="********"
  1073. fi
  1074. if [ -n "${adminpassword}" ]; then
  1075. adminpassword="********"
  1076. fi
  1077. if [ -n "${statspassword}" ]; then
  1078. statspassword="********"
  1079. fi
  1080. if [ -n "${webadminpass}" ]; then
  1081. webadminpass="********"
  1082. fi
  1083. if [ -n "${telnetpass}" ]; then
  1084. telnetpass="********"
  1085. fi
  1086. if [ -n "${wsapikey}" ]; then
  1087. wsapikey="********"
  1088. fi
  1089. if [ -n "${gslt}" ]; then
  1090. gslt="********"
  1091. fi
  1092. fi
  1093. }