make host show_key use just the pgp pub key file to get the ssh fingerprint, as it...
[monkeysphere.git] / src / monkeysphere-host
index 64023e056c7ad6de9e6a1c5bf978d503010ecfbf..ff28486a1b8f7ec36342a25508935c77948e0fb1 100755 (executable)
@@ -66,12 +66,12 @@ subcommands:
  revoke-key (r)                      revoke host key
  publish-key (p)                     publish host key to keyserver
 
- expert <expert-subcommand>          run expert command
- expert help                         expert command help
+ import-key (i) [NAME[:PORT]]        import existing ssh key to gpg
 
  version (v)                         show version number
  help (h,?)                          this help
 
+See ${PGRM}(8) for more info.
 EOF
 }
 
@@ -175,8 +175,7 @@ show_key() {
 
     echo -n "ssh fingerprint: "
     ssh-keygen -l -f /dev/stdin \
-       <<<$( gpg_host --export FEE16FA3 2>/dev/null \
-       | openpgp2ssh 8445B5203A8443B4B04F637DD4DE66B2FEE16FA3 2>/dev/null) \
+       <<<$(openpgp2ssh <"$HOST_KEY_FILE" 2>/dev/null) \
        | awk '{ print $1, $2, $4 }'
 
     # FIXME: other relevant key parameters?
@@ -269,47 +268,16 @@ case $COMMAND in
        publish_key
        ;;
 
-    'expert')
-       SUBCOMMAND="$1"
-       shift
-       case "$SUBCOMMAND" in
-           'help'|'h'|'?')
-               cat <<EOF
-usage: $PGRM expert <subcommand> [options] [args]
-
-expert subcommands:
- import-key (i) [NAME[:PORT]]        import existing ssh key to gpg
- gen-key (g) [NAME[:PORT]]           generate gpg key for the host
-   --length (-l) BITS                  key length in bits (2048)
- diagnostics (d)                     monkeysphere host status
+    'import-key'|'i')
+       load_fingerprint
+       check_host_key
+       source "${MHSHAREDIR}/import_key"
+       import_key "$@"
+       ;;
 
-EOF
-               ;;
-
-           'import-key'|'i')
-               load_fingerprint
-               check_host_key
-               source "${MHSHAREDIR}/import_key"
-               import_key "$@"
-               ;;
-
-           'gen-key'|'g')
-               load_fingerprint
-               check_host_key
-               source "${MHSHAREDIR}/gen_key"
-               gen_key "$@"
-               ;;
-
-           'diagnostics'|'d')
-               source "${MHSHAREDIR}/diagnostics"
-               diagnostics
-               ;;
-
-           *)
-               failure "Unknown expert subcommand: '$COMMAND'
-Type '$PGRM help' for usage."
-               ;;
-       esac
+    'diagnostics'|'d')
+       source "${MHSHAREDIR}/diagnostics"
+       diagnostics
        ;;
 
     'version'|'v')