diff options
Diffstat (limited to 'ssh-privsend')
-rwxr-xr-x | ssh-privsend | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ssh-privsend b/ssh-privsend index 8767f57..3770898 100755 --- a/ssh-privsend +++ b/ssh-privsend @@ -3,10 +3,24 @@ # Send both public and private keys to a server. # +# Parameters +BASENAME="`basename $0`" KEY="$1" SERVER="$2" DESTKEY="~/.ssh/`basename $KEY`" +# Checks +if [ -z "$KEY" ]; then + echo "usage: $BASENAME <private-key-file>" + exit 1 +elif [ ! -e "$KEY" ]; then + echo "$BASENAME: file not found: $KEY" + exit 1 +elif [ ! -e "$KEY.pub" ]; then + echo "$BASENAME: file not found: $KEY.pub" + exit 1 +fi + # Put on authorized_keys #ssh-authorized-send $KEY.pub |