#!/bin/bash

D1=D
D2=("COPY SSH KEY TO REMOTE HOST")

function copy_ssh_key {

    yesnobox "Warning ! This will not work when the login shell for the remote user is Conmen. Continue ?"

    if [ "$YNRETVAL" = "0" ]; then
	inputbox "Enter remote username or hit enter for [$USR]"
	USR=${INPUT:=$USR}

	if [ "$RETVAL" = "0" ]; then 
	    inputbox "Enter remote hostname or hit enter for [$RHOST]"
	    RHOST=${INPUT:=$RHOST}
	fi

	saverc

	[ "$RETVAL" = "0" ] && exec_command --xterm "ssh-copy-id -i $HOME/.ssh/identity.pub $USR@$RHOST"
    fi
}
