View Single Post

  #5 (permalink)  
Old 04-02-2006, 04:30 PM
sparky sparky is offline
Member
User
 
Join Date: Mar 2006
Posts: 35
Rep Power: 0
sparky
Default

what it is i am helping a friend run a counterstrike source dedicated servers
He ne not very comfortable using ssh so thought even though i am new to linux myself i would write so scripts to make the job easy the first on my last post mean't he could turn on any servers just be answering a few questions
this script will hopefully change to rcon password for each server

Code:
// server name
hostname "mtservers" 

rcon_password "foo"

// Server password
sv_password "edmatch" 

// server cvars
log 0
mp_friendlyfire 1 
mp_footsteps 1 
mp_autoteambalance 0 
mp_autokick 0 
mp_flashlight 0
i have tried
Code:
sed -e 's/rcon_password "*"/rcon_password "bar"/g' server.cfg > server1.cfg
and i get this
Code:
// server name
hostname "mtservers" 

rcon_password "bar"foo"

// Server password
sv_password "edmatch" 

// server cvars
log 0
mp_friendlyfire 1 
mp_footsteps 1 
mp_autoteambalance 0 
mp_autokick 0 
mp_flashlight 0
i.ve tried
Code:
 perl -p -i -e 's/rcon_password "*"/rcon_password "bar"/g' server.cfg
output
Code:
// server name
hostname "mtservers" 

rcon_password "bar"foo"

// Server password
sv_password "edmatch" 

// server cvars
log 0
mp_friendlyfire 1 
mp_footsteps 1 
mp_autoteambalance 0 
mp_autokick 0 
mp_flashlight 0
so as you can see can t get a wild card to work
From what ive read "" '' `` can cause u hasle may be that where i am going wrong
peal works best as i don t need to make new file and it works fine if i type the old pass but that defeats the object of the script.
Anyway thanks for any help
Reply With Quote