Changing an IP in a config file with sed

While updating the configs on a bunch of our Cascade Shark appliances I had to do it via SSH (yay for someone stuffing the RADIUS configurations!)

sed’s neat, but of course anything with regex can make you angry. Once I’d tested it a bunch of different ways I went with this. The cat’s are for my own checking – I copy and paste the terminal into a big “log of my brainfarts” when doing stuff at 5am.

cat /opt/local/pilot/bin/configuration/Pilot.Server.conf | grep profilers.address
sed -i.backup 's/10.2.236.80/10.2.236.81/' /opt/local/pilot/bin/configuration/Pilot.Server.conf 
cat /opt/local/pilot/bin/configuration/Pilot.Server.conf | grep profilers.address 
/etc/init.d/pilot restart

As usual, this post is more of a reminder to myself than anything else 🙂



#command line #Riverbed Cascade #sed