Urban Terror Forums: retrieve rcon-password from machine. - Urban Terror Forums

Jump to content

 Login | Register 
Advertisement
Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

retrieve rcon-password from machine. Rate Topic: -----

#1 User is offline   arclite Icon

  • Account: arclite
  • Country:
  • Joined: 24-August 10
  • Posts: 22

Posted 22 August 2011 - 08:44 AM

hello all!

I am running a server with some servers.
I need to make a script in the server machine (linux) which retrieve rcon pass for each servers, because I would to print in a text file the "status" command every X time using something like multircon.

thank you to all!

#2 User is offline   3spades Icon

  •   gameserver owner   
    Support Guy
  • Account: 3spades
  • Country:
  • Joined: 28-February 10
  • Posts: 389

Posted 26 August 2011 - 09:31 PM

$ multircon -p `grep rconpassword /path/to/q3ut4/server.cfg | awk {'print $3'} |tr -d '"'` -s 0 -c status ip port

This post has been edited by 3spades: 26 August 2011 - 09:33 PM

urt.voxel.net :: Ruining your URT experience [2] weapons limited servers at a time.
Kevlar in CTF is like sex with a condom. Sure you get the general feel of things, but everyone would enjoy the game without it.

#3 User is offline   arclite Icon

  • Account: arclite
  • Country:
  • Joined: 24-August 10
  • Posts: 22

Posted 27 August 2011 - 03:46 PM

okay and how does this command work?
it takes password from server.cfg, and then?

I can't understand this piece:

Quote

awk {'print $3'} |tr -d '"'


can you explain me it? thank you! :biggrin:

I thought, how about take the rcon password from the screen session of urban terror game?
because it is possible to change rcon password during the game so it can be different in-game than in server configuration file.

so, I tried to launch

Quote

screen -S sessionname -X stuff 'command (status in this case)'


and I saw the command was launched properly, but really I don't know how to get return output...

thank you! have a good day! :tongue:

#4 User is offline   3spades Icon

  •   gameserver owner   
    Support Guy
  • Account: 3spades
  • Country:
  • Joined: 28-February 10
  • Posts: 389

Posted 27 August 2011 - 07:57 PM

grep rconpassword will return:
set rconpassword "pass"

awk {'print $3'} will print the third entry, in this case "pass"

tr -d '"' will trim character, delete, quote marks so the command will execute

multircon -p pass -s 0 -c status ip port


If you change your password during the game and not in the server.cfg, it will revert next time you exec server.cfg. I restart all my servers at 4am with cron.daily so I make no password changes unless I do it in server.cfg. I don't really care to try to interact with the screen as I have all my games in a single screen as well.
urt.voxel.net :: Ruining your URT experience [2] weapons limited servers at a time.
Kevlar in CTF is like sex with a condom. Sure you get the general feel of things, but everyone would enjoy the game without it.

#5 User is offline   arclite Icon

  • Account: arclite
  • Country:
  • Joined: 24-August 10
  • Posts: 22

Posted 28 August 2011 - 08:57 AM

OKay, thank you!

anyway if you try to interact with screen sessions, you can get real-time parameters.
so, for any reason you will change your password during the game, like an administrator and you need to get server status when password is changed, you won't be able to get anything because password in the server.cfg doesn't match with in-game password.
and for any reason you choosed to change gametype or other settings of your game as well if you try to restart your game, first you can't do it without correct password and second you would change all settings to default of your file.

I think it is easy to send command to a screen session, almost I am able to make it, the problem is to get back output.

thank you again! I will try your multircon solution and will search for screen if you will be interested.

have a good day! ;-)

P.S.: how can you run more game servers only in a screen session? :rolleyes:

#6 User is offline   3spades Icon

  •   gameserver owner   
    Support Guy
  • Account: 3spades
  • Country:
  • Joined: 28-February 10
  • Posts: 389

Posted 29 August 2011 - 01:17 AM

You can have multiple sessions in screen. http://www.cyberciti...mand-howto.html
urt.voxel.net :: Ruining your URT experience [2] weapons limited servers at a time.
Kevlar in CTF is like sex with a condom. Sure you get the general feel of things, but everyone would enjoy the game without it.

#7 User is offline   arclite Icon

  • Account: arclite
  • Country:
  • Joined: 24-August 10
  • Posts: 22

Posted 29 August 2011 - 09:18 AM

oh OKay!
I thought you can run multiple scripts only in a screen session, instead it is in a ssh session you can run multiple screen for multiple scripts.

okay, thank you.

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

Advertisement


Copyright © 1999-2019 Frozensand Games Limited  |  All rights reserved  |  Urban Terror™ and FrozenSand™ are trademarks of Frozensand Games Limited

Frozensand Games is a Limited company registered in England and Wales. Company Reg No: 10343942