#!/bin/sh

PATH="/bin:/sbin:/usr/bin:/usr/sbin"

# Find a working one. Try one from  host -tNS bg.
#ns="ns2.digsys.bg"
outfile="index.html"
tmpdir="."
tmpfile="index_`date +%Y-%m-%d`.html"


cd `dirname $0`

echo "Downloading...."     && host -l -r bg. $ns > bg_dom
echo "Lines: `wc -l bg_dom`"
echo "Parsing..."          && cat bg_dom | grep "name server" | sed -e "s|\. .*||"| cut -d" " -f1 | sort | uniq > bg_dom_clear
echo "Generating index..." && ./bg_dom_make.sh > $tmpdir/$tmpfile
ln -svf $tmpdir/$tmpfile $outfile

