Its a simple sh script that can be run remotely. It replaces all =
instances of mgw2 with mgw1 and all instances of the ip address as well. =
Yeah its not realy pretty but it works.=20

######### PART 1 (server) ###################
[EMAIL PROTECTED] [/etc/postfix/bin]# sh sync.server
[EMAIL PROTECTED] [/etc/postfix/bin]> cat sync.server
/usr/bin/su scp -c '/usr/bin/scp /etc/postfix/config/*.map =
[EMAIL PROTECTED]:/etc/postfix/config/test'
/usr/bin/su scp -c '/usr/bin/scp /etc/postfix/config/*.regexp =
[EMAIL PROTECTED]:/etc/postfix/config/test'
/usr/bin/su scp -c 'ssh [EMAIL PROTECTED] sudo =
/etc/postfix/config/test/sync.client'
/usr/bin/su scp -c 'ssh [EMAIL PROTECTED] sudo /etc/postfix/bin/makemaps'

######### PART 2 (client) ###################
[EMAIL PROTECTED] [/etc/postfix/config/test]# sh sync.client `/bin/ls *.map`
[EMAIL PROTECTED] [/etc/postfix/config/test]# cat sync.client
while [ 1 -le $# ]
do

sed s/mgw1/"mgwX"/g \
 </etc/postfix/config/test/${1} |\
 cat > /etc/postfix/config/test/${1}

sed s/mgw2/"mgw1"/g \
 </etc/postfix/config/test/${1} |\
 cat > /etc/postfix/config/test/${1}

sed s/mgwX/"mgw2"/g \
 </etc/postfix/config/test/${1} |\
 cat > /etc/postfix/config/test/${1}

sed s/64\.154\.20\.20/"64.154.20.X"/g \
 </etc/postfix/config/test/${1} |\
 cat > /etc/postfix/config/test/${1}

sed s/64\.154\.20\.19/"64.154.20.20"/g \
 </etc/postfix/config/test/${1} |\
 cat > /etc/postfix/config/test/${1}

sed s/64\.154\.20\.X/"64.154.20.19"/g \
 </etc/postfix/config/test/${1} |\
 cat > /etc/postfix/config/test/${1}


shift

done


Keith J. Kikta
[EMAIL PROTECTED]
voice: 1.800.697.7088=20
fax: 713.868.2268
http://www.iland.com/ - iland Internet Solutions Corporation=20
The information transmitted is intended only for the person or entity to =

which it is addressed and may contain confidential and/or privileged=20
material. Any review, re-transmission, dissemination or other use of, or =

taking of any action in reliance upon, this information by persons or=20
entities other than the intended recipient is prohibited. If you =
received=20
this in error, please contact the sender and delete the material from =
any=20
computer.


Reply via email to