info_messages.sh 36 KB

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