]> mj.ucw.cz Git - nsc-5.git/blobdiff - bin/key-update
DNSSEC: Complete support for key delegations to sub-domains
[nsc-5.git] / bin / key-update
index b033eba941fd9155aa57bc3957dc428a152dcf1d..e7efe3626343d09a79946337767329d4282b610b 100755 (executable)
@@ -7,16 +7,16 @@ shopt -s nullglob
 . bin/shell-env
 
 if [ $# -gt 1 ] ; then
 . bin/shell-env
 
 if [ $# -gt 1 ] ; then
-       echo >&2 "Usage: $0 [<domain>]"
+       echo >&2 "Usage: $0 [<zone>]"
        exit 1
 fi
 
 update ()
 {
        local D=$1
        exit 1
 fi
 
 update ()
 {
        local D=$1
-       local K=$KEYDIR/$D
-       local H=$K.hash
-       cat $K/*.key | sha1sum | cut -f1 -d' ' >$H.new
+       local K=keys/$D
+       local H=khash/$D
+       cat /dev/null $K/*.key | sha1sum | cut -f1 -d' ' >$H.new
        if [ ! -f $H ] || ! cmp -s $H $H.new ; then
                echo "** $D: New key hash"
                mv $H.new $H
        if [ ! -f $H ] || ! cmp -s $H $H.new ; then
                echo "** $D: New key hash"
                mv $H.new $H
@@ -27,14 +27,14 @@ update ()
 }
 
 if [ -z "$1" ] ; then
 }
 
 if [ -z "$1" ] ; then
-       for DD in $KEYDIR/* ; do
+       for DD in keys/* ; do
                if [ -d "$DD" ] ; then
                        update $(basename $DD)
                fi
        done
                if [ -d "$DD" ] ; then
                        update $(basename $DD)
                fi
        done
-       for H in $KEYDIR/*.hash ; do
-               B=$(basename $H .hash)
-               if [ ! -d $KEYDIR/$B ] ; then
+       for H in khash/* ; do
+               B=$(basename $H)
+               if [ ! -d keys/$B ] ; then
                        echo "## $B: Deleted obsolete hash"
                        rm $H
                fi
                        echo "## $B: Deleted obsolete hash"
                        rm $H
                fi