#!/usr/local/bin/bash # sed -e "s/$1/$2/" $3 > $3.rplzz cp mrtg-template.cfg mrtg-template.cfg-backup rm mrtg-template.cfg && touch mrtg-template.cfg for i in `ifconfig -a | egrep '(64.71|216.218)' | cut -f2 -d ' '`; do `sed -e "s/ZOIDIALADDY/$i/" template-file > template.temp && sed -e "s/ZOIDIALADDY/$i/" template.temp >> mrtg-template.cfg`; done