info_messages.sh 34 KB

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