X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=src%2Fsubcommands%2Fmh%2Fimport-key;h=386e02d4556d2f89a2a63a1d4124cfa4aafd3603;hb=6923ef580f068ff535af273714e59235260ab7b6;hp=c33550b08f05ecef4b347c5a4d823728ebb93fb0;hpb=53fdf9b3e431d9f3538c1b2196276492bec2fc7e;p=monkeysphere.git diff --git a/src/subcommands/mh/import-key b/src/subcommands/mh/import-key old mode 100755 new mode 100644 index c33550b..386e02d --- a/src/subcommands/mh/import-key +++ b/src/subcommands/mh/import-key @@ -1,14 +1,17 @@ -#!/usr/bin/env bash +# -*-shell-script-*- +# This should be sourced by bash (though we welcome changes to make it POSIX sh compliant) # Monkeysphere host import-key subcommand # # The monkeysphere scripts are written by: -# Jameson Rollins +# Jameson Rollins # Jamie McClelland # Daniel Kahn Gillmor # -# They are Copyright 2008, and are all released under the GPL, version 3 -# or later. +# They are Copyright 2008-2009 and are all released under the GPL, +# version 3 or later. + +import_key() { local hostName=$(hostname -f) local keyFile="/etc/ssh/ssh_host_rsa_key" @@ -23,10 +26,6 @@ fingerprint_server_key >/dev/null \ # get options while true ; do case "$1" in - -h|--hostname) - hostName="$2" - shift 2 - ;; -f|--keyfile) keyFile="$2" shift 2 @@ -40,6 +39,9 @@ while true ; do failure "Unknown option '$1'. Type '$PGRM help' for usage." fi + hostName="$1" + shift + ;; break ;; esac @@ -82,4 +84,6 @@ gpg_authentication "--export-options export-minimal --armor --export 0x${fingerp log info "SSH host public key in OpenPGP form: ${SYSDATADIR}/ssh_host_rsa_key.pub.gpg" # show info about new key -show_server_key +show_key + +}