The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,224 other subscribers

Getting a fresh root hint file on SUSE 12.x

Posted by jpluimers on 2013/07/31

Wrote a small script that goes into my monthly crontab.

It gets into /var/lib/named/, and logs when you need to copy it over into /var/lib/named/root.hint

#! /bin/sh


#echo "$RootHint"
#echo "$NamedCacheDownloadPath"
#echo ""
#echo "$FtpNamedCacheDownloadPath"
#echo "$VarLibNamedNamedCache"
#echo "$VarLibNamedNamedCacheNew"

cd $VarLibNamed
wget -q -N ftp://$NamedCacheDownloadPath

if (test -e $VarLibNamedNamedCache) ; then

  diff $VarLibNamedNamedCache $VarLibNamedNamedCacheNew

  if [ "$?" -ne "0" ] ; then
  # if $VarLibNamedNamedCacheNew does not exist, or $VarLibNamedNamedCache is different from $VarLibNamedNamedCacheNew

    cp -f $VarLibNamedNamedCache $VarLibNamedNamedCacheNew
    echo "There is a fresh $VarLibNamedNamedCacheNew file that you might want to update into $VarLibNamedRootHint"

  diff $VarLibNamedRootHint $VarLibNamedNamedCacheNew

  if [ "$?" -ne "0" ] ; then
  # if $VarLibNamedNamedCacheNew does not exist, or $VarLibNamedRootHint is different from $VarLibNamedNamedCacheNew

#    rcnamed restart
    echo "$VarLibNamedRootHint is different from $VarLibNamedNamedCacheNew, you might need to update $VarLibNamedRootHint, then perform rcnamed restart "

  rm -f $VarLibNamedNamedCache


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: