info_config.sh 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. #!/bin/bash
  2. # LGSM info_config.sh function
  3. # Author: Daniel Gibbs
  4. # Contributor: UltimateByte
  5. # Website: https://gameservermanagers.com
  6. # Description: Gets specific details from config files.
  7. local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  8. ## Examples of filtering to get info from config files
  9. # sed 's/foo//g' - remove foo
  10. # tr -cd '[:digit:]' leave only digits
  11. # tr -d '=\"; ' remove selected characters =\";
  12. # grep -v "foo" filter out lines that contain foo
  13. # cut -f1 -d "/" remove everything after /
  14. fn_info_config_avalanche(){
  15. if [ ! -f "${servercfgfullpath}" ]; then
  16. servername="${unavailable}"
  17. serverpassword="${unavailable}"
  18. slots="${zero}"
  19. port="${zero}"
  20. else
  21. servername=$(grep "Name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Name//g' | tr -d '=\";,:' | xargs)
  22. serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | xargs)
  23. slots=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
  24. port=$(grep "BindPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
  25. # Not Set
  26. servername=${servername:-"NOT SET"}
  27. serverpassword=${serverpassword:-"NOT SET"}
  28. slots=${slots:-"0"}
  29. port=${port:-"0"}
  30. # check if the ip exists in the config file. Failing this will fall back to the default.
  31. ipconfigcheck=$(grep "BindIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/BindIP//g' | tr -d '=\";,:' | xargs)
  32. if [ -n "${ipconfigcheck}" ]; then
  33. ip="${ipconfigcheck}"
  34. fi
  35. fi
  36. }
  37. fn_info_config_dontstarve(){
  38. if [ ! -f "${servercfgfullpath}" ]; then
  39. servername="${unavailable}"
  40. serverpassword="${unavailable}"
  41. slots="${zero}"
  42. gamemode="${unavailable}"
  43. tickrate="${zero}"
  44. port="${zero}"
  45. else
  46. servername=$(grep "default_server_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/default_server_name//g' | tr -d '=\";,:' | xargs)
  47. serverpassword=$(grep "server_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_password//g' | tr -d '=\";,:' | xargs)
  48. slots=$(grep "max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  49. gamemode=$(grep "game_mode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/game_mode//g' | tr -d '=\";,:' | xargs)
  50. tickrate=$(grep "tick_rate" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  51. port=$(grep "server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  52. # Not Set
  53. servername=${servername:-"NOT SET"}
  54. serverpassword=${serverpassword:-"NOT SET"}
  55. slots=${slots:-"0"}
  56. gamemode=${gamemode:-"NOT SET"}
  57. tickrate=${tickrate:-"0"}
  58. port=${port:-"0"}
  59. fi
  60. }
  61. fn_info_config_minecraft(){
  62. if [ ! -f "${servercfgfullpath}" ]; then
  63. servername="${unavailable}"
  64. rconpassword="${unavailable}"
  65. rconport="${zero}"
  66. slots="${zero}"
  67. port="${zero}"
  68. gamemode="${unavailable}"
  69. gameworld="${unavailable}"
  70. else
  71. servername=$(grep "motd" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/motd//g' | tr -d '=\";,:' | xargs)
  72. rconpassword=$(grep "rcon.password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon.password//g' | tr -d '=\";,:' | xargs)
  73. rconport=$(grep "rcon.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  74. slots=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  75. port=$(grep "server-port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  76. gamemode=$(grep "gamemode" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  77. gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | xargs)
  78. # Not Set
  79. servername=${servername:-"NOT SET"}
  80. rconpassword=${rconpassword:-"NOT SET"}
  81. rconport=${rconport:-"NOT SET"}
  82. slots=${slots:-"NOT SET"}
  83. port=${port:-"NOT SET"}
  84. gamemode=${gamemode:-"NOT SET"}
  85. gameworld=${gameworld:-"NOT SET"}
  86. # check if the ip exists in the config file. Failing this will fall back to the default.
  87. ipconfigcheck=$(grep "server-ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/server-ip//g' | tr -d '=\";,:' | xargs)
  88. if [ -n "${ipconfigcheck}" ]; then
  89. ip="${ipconfigcheck}"
  90. fi
  91. fi
  92. }
  93. fn_info_config_projectzomboid(){
  94. if [ ! -f "${servercfgfullpath}" ]; then
  95. servername="${unavailable}"
  96. serverpassword="${unavailable}"
  97. rconpassword="${unavailable}"
  98. slots="${zero}"
  99. port="${zero}"
  100. gameworld="${unavailable}"
  101. else
  102. servername=$(grep "PublicName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/PublicName//g' | tr -d '=\";,:' | xargs)
  103. serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Password" | sed -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | xargs)
  104. rconpassword=$(grep "RCONPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/RCONPassword//g' | tr -d '=\";,:' | xargs)
  105. slots=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  106. port=$(grep "DefaultPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
  107. gameworld=$(grep "Map" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Map" | sed -e '/^#/d' -e 's/Map//g' | tr -d '=\";' | xargs)
  108. # Not Set
  109. servername=${servername:-"NOT SET"}
  110. serverpassword=${serverpassword:-"NOT SET"}
  111. rconpassword=${rconpassword:-"NOT SET"}
  112. slots=${slots:-"NOT SET"}
  113. port=${port:-"NOT SET"}
  114. gameworld=${gameworld:-"NOT SET"}
  115. fi
  116. }
  117. fn_info_config_idtech3(){
  118. if [ ! -f "${servercfgfullpath}" ]; then
  119. rconpassword="${unavailable}"
  120. servername="${unavailable}"
  121. serverpassword="${unavailable}"
  122. slots="${zero}"
  123. else
  124. rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | xargs)
  125. servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | xargs)
  126. serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | xargs)
  127. slots=$(grep "sv_maxClients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  128. # Not Set
  129. rconpassword=${rconpassword:-"NOT SET"}
  130. servername=${servername:-"NOT SET"}
  131. serverpassword=${serverpassword:-"NOT SET"}
  132. slots=${slots:-"0"}
  133. fi
  134. }
  135. fn_info_config_realvirtuality(){
  136. if [ ! -f "${servercfgfullpath}" ]; then
  137. servername="${unavailable}"
  138. adminpassword="${unavailable}"
  139. serverpassword="${unavailable}"
  140. slots="${zero}"
  141. else
  142. servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | xargs)
  143. adminpassword=$(grep "passwordAdmin" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/passwordAdmin//g' | tr -d '=\";,:' | xargs)
  144. serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | xargs)
  145. slots=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  146. # Not Set
  147. servername=${servername:-"NOT SET"}
  148. adminpassword=${adminpassword:-"NOT SET"}
  149. serverpassword=${serverpassword:-"NOT SET"}
  150. slots=${slots:-"0"}
  151. fi
  152. }
  153. fn_info_config_seriousengine35(){
  154. if [ ! -f "${servercfgfullpath}" ]; then
  155. servername="${unavailable}"
  156. rconpassword="${unavailable}"
  157. gamemode="${unavailable}"
  158. slots="${zero}"
  159. port="${zero}"
  160. else
  161. servername=$(grep "prj_strMultiplayerSessionName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/prj_strMultiplayerSessionName//g' | tr -d '=\";,:' | xargs)
  162. rconpassword=$(grep "rcts_strAdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcts_strAdminPassword//g' | tr -d '=\";,:' | xargs)
  163. gamemode=$(grep "gam_idGameMode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/gam_idGameMode//g' | tr -d '=\";,:' | xargs)
  164. slots=$(grep "gam_ctMaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  165. port=$(grep "prj_uwPort" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  166. # Not Set
  167. servername=${servername:-"NOT SET"}
  168. rconpassword=${rconpassword:-"NOT SET"}
  169. gamemode=${gamemode:-"NOT SET"}
  170. slots=${slots:-"0"}
  171. port=${port:-"0"}
  172. fi
  173. }
  174. fn_info_config_source(){
  175. if [ ! -f "${servercfgfullpath}" ]; then
  176. servername="${unavailable}"
  177. serverpassword="${unavailable}"
  178. rconpassword="${unavailable}"
  179. else
  180. servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | xargs)
  181. serverpassword=$(grep "sv_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/sv_password//g' | tr -d '=\";,:' | xargs)
  182. rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcon_password//g' | tr -d '=\";,:' | xargs)
  183. # Not Set
  184. servername=${servername:-"NOT SET"}
  185. serverpassword=${serverpassword:-"NOT SET"}
  186. rconpassword=${rconpassword:-"NOT SET"}
  187. fi
  188. }
  189. fn_info_config_starbound(){
  190. if [ ! -f "${servercfgfullpath}" ]; then
  191. servername="${unavailable}"
  192. rconpassword="${unavailable}"
  193. port="21025"
  194. queryport="21025"
  195. rconport="21026"
  196. slots="8"
  197. else
  198. servername=$(grep "serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/serverName//g' | tr -d '=\";,:' | xargs)
  199. rconpassword=$(grep "rconServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/rconServerPassword//g' | tr -d '=\";,:' | xargs)
  200. port=$(grep "gameServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
  201. queryport=$(grep "queryServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
  202. rconport=$(grep "rconServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
  203. slots=$(grep "maxPlayers" "${servercfgfullpath}" | tr -cd '[:digit:]')
  204. # Not Set
  205. servername=${servername:-"NOT SET"}
  206. rconpassword=${rconpassword:-"NOT SET"}
  207. port=${port:-"21025"}
  208. queryport=${queryport:-"21025"}
  209. rconport=${rconport:-"21026"}
  210. slots=${slots:-"8"}
  211. fi
  212. }
  213. fn_info_config_teamspeak3(){
  214. if [ ! -f "${servercfgfullpath}" ]; then
  215. dbplugin="${unavailable}"
  216. port="9987"
  217. queryport="10011"
  218. fileport="30033"
  219. else
  220. dbplugin=$(grep "dbplugin=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/dbplugin=//g' | tr -d '=\";,:' | xargs)
  221. port=$(grep "default_voice_port" "${servercfgfullpath}" | tr -cd '[:digit:]')
  222. queryport=$(grep "query_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  223. fileport=$(grep "filetransfer_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  224. # Not Set
  225. port=${port:-"9987"}
  226. queryport=${queryport:-"10011"}
  227. fileport=${fileport:-"30033"}
  228. # check if the ip exists in the config file. Failing this will fall back to the default.
  229. ipconfigcheck=$(grep "voice_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/voice_ip//g' | tr -d '=\";,:' | xargs)
  230. if [ -n "${ipconfigcheck}" ]; then
  231. ip="${ipconfigcheck}"
  232. fi
  233. fi
  234. }
  235. fn_info_config_mumble(){
  236. if [ ! -f "${servercfgfullpath}" ]; then
  237. port="64738"
  238. queryport="${port}"
  239. servername="Mumble"
  240. else
  241. port=$(grep "port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^;/d' -e 's/port//g' | tr -d '=\";,:' | xargs)
  242. queryport="${port}"
  243. # Not Set
  244. port=${port:-"64738"}
  245. queryport=${queryport:-"64738"}
  246. servername="Mumble Port ${port}"
  247. # check if the ip exists in the config file. Failing this will fall back to the default.
  248. ipconfigcheck=$(cat "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^;/d' -e 's/voice_ip//g' | tr -d '=\";,:' | xargs)
  249. if [ -n "${ipconfigcheck}" ]; then
  250. ip="${ipconfigcheck}"
  251. fi
  252. fi
  253. }
  254. fn_info_config_teeworlds(){
  255. if [ ! -f "${servercfgfullpath}" ]; then
  256. servername="unnamed server"
  257. serverpassword="${unavailable}"
  258. rconpassword="${unavailable}"
  259. port="8303"
  260. slots="12"
  261. else
  262. servername=$(grep "sv_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_name//g' | tr -d '=\";,:' | xargs)
  263. serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^password" | sed -e '/^#/d' -e 's/^password//g' | tr -d '=\";,:' | xargs)
  264. rconpassword=$(grep "sv_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_rcon_password//g' | tr -d '=\";,:' | xargs)
  265. port=$(grep "sv_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  266. slots=$(grep "sv_max_clients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  267. # Not Set
  268. servername=${servername:-"NOT SET"}
  269. serverpassword=${serverpassword:-"NOT SET"}
  270. rconpassword=${rconpassword:-"NOT SET"}
  271. port=${port:-"8303"}
  272. slots=${slots:-"12"}
  273. fi
  274. }
  275. fn_info_config_terraria(){
  276. if [ ! -f "${servercfgfullpath}" ]; then
  277. servername="${unavailable}"
  278. port="${zero}"
  279. gameworld="${unavailable}"
  280. slots="${zero}"
  281. else
  282. servername=$(grep "worldname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/worldname//g' | tr -d '=\";,:' | xargs)
  283. port=$(grep "port" "${servercfgfullpath}" | tr -cd '[:digit:]')
  284. gameworld=$(grep "world=" "${servercfgfullpath}" | grep -v "#" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/world=//g' | tr -d '=\";,:' | xargs)
  285. slots=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  286. # Not Set
  287. servername=${servername:-"NOT SET"}
  288. port=${port:-"0"}
  289. gameworld=${gameworld:-"NOT SET"}
  290. slots=${slots:-"0"}
  291. fi
  292. }
  293. fn_info_config_unreal(){
  294. if [ ! -f "${servercfgfullpath}" ]; then
  295. servername="${unavailable}"
  296. serverpassword="${unavailable}"
  297. adminpassword="${unavailable}"
  298. port="${zero}"
  299. gsqueryport="${zero}"
  300. webadminenabled="${unavailable}"
  301. webadminport="${zero}"
  302. webadminuser="${unavailable}"
  303. webadminpass="${unavailable}"
  304. else
  305. servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | xargs)
  306. serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | xargs)
  307. adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | xargs)
  308. port=$(grep "Port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]')
  309. gsqueryport=$(grep "OldQueryPortNumber" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  310. webadminenabled=$(grep "bEnabled" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | xargs)
  311. webadminport=$(grep "ListenPort" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
  312. if [ "${engine}" == "unreal" ]; then
  313. webadminuser=$(grep "AdminUsername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminUsername//g' | tr -d '=\";,:' | xargs)
  314. webadminpass=$(grep "UTServerAdmin.UTServerAdmin" "${servercfgfullpath}" -A 4 | grep "AdminPassword" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | xargs)
  315. else
  316. webadminuser=$(grep "AdminName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminName//g' | tr -d '=\";,:' | xargs)
  317. webadminpass="${adminpassword}"
  318. fi
  319. # Not Set
  320. servername=${servername:-"NOT SET"}
  321. serverpassword=${serverpassword:-"NOT SET"}
  322. adminpassword=${adminpassword:-"NOT SET"}
  323. port=${port:-"0"}
  324. gsqueryport=${gsqueryport:-"0"}
  325. webadminenabled=${webadminenabled:-"NOT SET"}
  326. webadminport=${webadminport:-"0"}
  327. webadminuser=${webadminuser:-"NOT SET"}
  328. webadminpass=${webadminpass:-"NOT SET"}
  329. fi
  330. }
  331. fn_info_config_sdtd(){
  332. if [ ! -f "${servercfgfullpath}" ]; then
  333. servername="${unavailable}"
  334. serverpassword="${unavailable}"
  335. port="${zero}"
  336. queryport="${zero}"
  337. webadminenabled="${unavailable}"
  338. webadminport="${zero}"
  339. webadminpass="${unavailable}"
  340. telnetenabled="${unavailable}"
  341. telnetport="${zero}"
  342. telnetpass="${unavailable}"
  343. slots="${unavailable}"
  344. gamemode="${unavailable}"
  345. gameworld="${unavailable}"
  346. else
  347. servername=$(grep "ServerName" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
  348. serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
  349. port=$(grep "ServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
  350. queryport=$((port + 1))
  351. webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
  352. webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
  353. webadminpass=$(grep "ControlPanelPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
  354. telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
  355. telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
  356. telnetpass=$(grep "TelnetPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
  357. slots=$(grep "ServerMaxPlayerCount" "${servercfgfullpath}" | tr -cd '[:digit:]')
  358. gamemode=$(grep "GameMode" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
  359. gameworld=$(grep "GameWorld" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
  360. # Not Set
  361. servername=${servername:-"NOT SET"}
  362. serverpassword=${serverpassword:-"NOT SET"}
  363. port=${port:-"0"}
  364. queryport=${queryport:-"0"}
  365. webadminenabled=${webadminenabled:-"NOT SET"}
  366. webadminport=${webadminport:-"0"}
  367. webadminpass=${webadminpass:-"NOT SET"}
  368. telnetenabled=${telnetenabled:-"NOT SET"}
  369. telnetport=${telnetport:-"0"}
  370. telnetpass=${telnetpass:-"NOT SET"}
  371. slots=${slots:-"NOT SET"}
  372. gamemode=${gamemode:-"NOT SET"}
  373. gameworld=${gameworld:-"NOT SET"}
  374. fi
  375. }
  376. # Just Cause 2
  377. if [ "${engine}" == "avalanche" ]; then
  378. fn_info_config_avalanche
  379. # Dont Starve Together
  380. elif [ "${engine}" == "dontstarve" ]; then
  381. fn_info_config_dontstarve
  382. # Quake Live
  383. elif [ "${engine}" == "idtech3" ]; then
  384. fn_info_config_idtech3
  385. # Minecraft
  386. elif [ "${engine}" == "lwjgl2" ]; then
  387. fn_info_config_minecraft
  388. # Project Zomboid
  389. elif [ "${engine}" == "projectzomboid" ]; then
  390. fn_info_config_projectzomboid
  391. # ARMA 3
  392. elif [ "${engine}" == "realvirtuality" ]; then
  393. fn_info_config_realvirtuality
  394. # Serious Sam
  395. elif [ "${engine}" == "seriousengine35" ]; then
  396. fn_info_config_seriousengine35
  397. # Source Engine Games
  398. elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
  399. fn_info_config_source
  400. # Starbound
  401. elif [ "${engine}" == "starbound" ]; then
  402. fn_info_config_starbound
  403. # TeamSpeak 3
  404. elif [ "${gamename}" == "TeamSpeak 3" ]; then
  405. fn_info_config_teamspeak3
  406. elif [ "${gamename}" == "Mumble" ]; then
  407. fn_info_config_mumble
  408. # Teeworlds
  409. elif [ "${engine}" == "teeworlds" ]; then
  410. fn_info_config_teeworlds
  411. # Terraria
  412. elif [ "${engine}" == "terraria" ]; then
  413. fn_info_config_terraria
  414. # Unreal/Unreal 2 engine
  415. elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
  416. fn_info_config_unreal
  417. # 7 Day To Die (unity3d)
  418. elif [ "${gamename}" == "7 Days To Die" ]; then
  419. fn_info_config_sdtd
  420. fi