info_messages.sh 35 KB

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