X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=bin%2Fkey-update;h=e7efe3626343d09a79946337767329d4282b610b;hb=8ee88613458f9f6249e03d6dfdd2c79e549ffd81;hp=b033eba941fd9155aa57bc3957dc428a152dcf1d;hpb=2c5837136158422b198dd306e66f71c4db87182f;p=nsc-5.git diff --git a/bin/key-update b/bin/key-update index b033eba..e7efe36 100755 --- a/bin/key-update +++ b/bin/key-update @@ -7,16 +7,16 @@ shopt -s nullglob . bin/shell-env if [ $# -gt 1 ] ; then - echo >&2 "Usage: $0 []" + echo >&2 "Usage: $0 []" 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 @@ -27,14 +27,14 @@ update () } if [ -z "$1" ] ; then - for DD in $KEYDIR/* ; do + for DD in keys/* ; do 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