Bash Script
am 21.11.2005 05:45:54 von Kev
Hi,
im trying to setup a RBL DNS server for my testing.
im trying to write a bash scrip that add the IP's to add bind zone.
im having a prb transferring the ip in reveres format (192.168.1.2 -->
2.1.168.192)
can any one help me to do this with a bash script ?
thanks a lot
Kev
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: Bash Script
am 21.11.2005 09:10:27 von Chris Largret
On Mon, 2005-11-21 at 10:45 +0600, Kev wrote:
> Hi,
>
> im trying to setup a RBL DNS server for my testing.
> im trying to write a bash scrip that add the IP's to add bind zone.
>
> im having a prb transferring the ip in reveres format (192.168.1.2 -->
> 2.1.168.192)
>
> can any one help me to do this with a bash script ?
I don't know too much about RBL DNS servers, but changing the number
sequence around for an IP should be pretty easy:
#!/bin/sh
IP='192.168.1.2'
echo $IP|sed -r
's/^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)$/\4.\3.\2.\1/'
Essentially, it performs a regular expression replace. It finds the four
groups of numbers and reverses the order (#4 goes first, #3 second,
etc.).
--
Chris Largret
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs