X-Git-Url: https://git.distorted.org.uk/~mdw/distorted-keys/blobdiff_plain/7b1fe7a30da02085479a6d5c3b3f8f0fc7fddf65..refs/heads/bakery:/keys.delete-keeper diff --git a/keys.delete-keeper b/keys.delete-keeper index edcb718..908e22e 100755 --- a/keys.delete-keeper +++ b/keys.delete-keeper @@ -54,9 +54,9 @@ if [ -d $KEYS/recov ]; then cd $KEYS/recov ## Work through the available recovery keys. - for r in $(find . -type l -name current -print); do - r=${r#./}; r=${r%/current} - if ! expr >/dev/null "Q$r" : "Q$R_LABEL"; then continue; fi + for r in *; do + if ! expr >/dev/null "Q$r" : "Q$R_WORD"; then continue; fi + if [ ! -l $r/current ]; then continue; fi ## Add the key to our list. recov="$recov$r " @@ -64,7 +64,7 @@ if [ -d $KEYS/recov ]; then ## Now work through the instances. ii="" for ri in $r/*; do - i=${ri##*/} + i=${ri#*/} case "$i" in *[!0-9]*) continue ;; esac ## Add the instance to our list. @@ -74,7 +74,7 @@ if [ -d $KEYS/recov ]; then ## this keeper set, or it also depends on at least one other set. If ## not, add it to the `deps' list. this=nil others=nil - for kp in $r/current/*.param; do + for kp in $ri/*.param; do k=${kp##*/}; k=${k%.param} case $k in $keeper) this=t ;; *) others=t ;; esac done