bin/sign: Don't continue processing after encountering a directive.
[ssh-ca] / bin / sign
index f275355..c1f7c62 100755 (executable)
--- a/bin/sign
+++ b/bin/sign
@@ -26,7 +26,8 @@ done
 
 ## Sign the various host keys.
 last=%%%
-echo >&5 "### BEGIN $domain KEYS (generated $date)"
+idomain=$domain
+echo >&5 "### BEGIN $idomain KEYS (generated $date)"
 while read line <&3; do
 
   ## Ignore comments and empty lines.
@@ -39,7 +40,7 @@ while read line <&3; do
   ## Read the host line.
   set -- $line
   case "$1" in
-    @domain) domain=$2 ;;
+    @domain) domain=$2; continue ;;
     @*) echo >&2 "$0: unknown directive \`$1'"; exit 1 ;;
   esac
   host=$1
@@ -78,7 +79,7 @@ while read line <&3; do
     ssh-keygen -lv -fhost/$host-$kt.pub | sed 's,^,| ,' >&4
   done
 done
-echo >&5 "### END $domain KEYS"
+echo >&5 "### END $idomain KEYS"
 exec 3>&- 4>&- 5>&-
 
 ## Sign the list.