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!
Advertisement
Page 1 of 1
retrieve rcon-password from machine.
#2
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.
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
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:
can you explain me it? thank you!
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
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!
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!
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!
#4
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
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.
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.
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
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?
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?
Advertisement
#6
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.
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.
Page 1 of 1
1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users
Advertisement