From owner-freebsd-isp Mon Dec 18 1:56:33 2000 From owner-freebsd-isp@FreeBSD.ORG Mon Dec 18 01:56:30 2000 Return-Path: Delivered-To: freebsd-isp@freebsd.org Received: from alex.belpak.by (alex.belpak.by [193.232.248.13]) by hub.freebsd.org (Postfix) with ESMTP id 5E5F137B400 for ; Mon, 18 Dec 2000 01:56:26 -0800 (PST) Received: from belpak.by (alex.belpak.by [193.232.248.13]) by alex.belpak.by (8.9.3/8.9.3) with ESMTP id LAA74692; Mon, 18 Dec 2000 11:51:17 +0200 (EET) (envelope-from alex@belpak.by) Sender: alexbl@alex.belpak.by Message-ID: <3A3DDE15.D8E377A9@belpak.by> Date: Mon, 18 Dec 2000 11:51:17 +0200 From: Alex Blagoveschensky Organization: Belpak network. X-Mailer: Mozilla 4.61 [en] (X11; I; FreeBSD 3.5-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: Dave Wilson Cc: freebsd-isp@FreeBSD.ORG Subject: Re: Off topic - shell skills References: Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Dave Wilson wrote: > Hi guys, howzit going ? > > I have about 600 DNS zones on my DNS server, now because we are changing IP > addresses on our mail server most of those zones' MX/A records will need > updating. > How do I write a shell script that will change: > > mail IN A 10.1.1.58 > > to: > > mail IN A 10.0.0.1 > > ? > > I need this script to parse through each zone, so when it finds "10.1.1.58" > in a zone it will change the "10.1.1.58" to "10.0.0.1". > Please help if you can. > > Thanks. ;-) hello. Try this. But what will you do with Serial in SOA ? ;-) #!/bin/sh for i in * do echo $i cat $i | sed 's/10\.1\.1\.58/10\.0\.0\.1/' >$$ mv $$ $i done -- Belpak Network http://alex.belpak.by To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message