So here is what I came up with.
Code:
#### Get current dns entry for the entered zone #
grep "^[^$|;|[:space:]].*[0-9][0-9]" $DNS/$DOMAIN.dns |
while read a
do
(( cnt++ ))
echo $cnt ") " $a
echo $a > TMP$cnt ## Super CheeseY #
done
Code:
#### Entry replacer or new entry #
read -p "Enter a number to edit the record or leave blank to add a new entry:" ENTRY
Code:
1 ) @ IN MX 10 mail.server.com.
2 ) mail IN A 111.111.111.111
3 ) @ IN A 111.111.111.111
4 ) www IN A 111.111.111.111
5 ) ftp IN A 111.111.111.111
6 ) localhost IN A 127.0.0.1
Enter a number to edit the record or leave blank to add a new entry:
Then I call the file up later on.
Code:
TMP=`cat TMP$ENTRY`
$ENTRY is a number
Seems to work well enough.
I clean up the files at the end.
Now... for one more ??? as I ran into another issue.
Code:
TABS=""
cnt=`echo 6-${#AIP}/2+1 | bc`
for i in $cnt
do
TABS=$TABS$'\t'
done
I only end up with one tab no matter what.
Is
that not a valid statement?
Thanks again.