diff --git a/CHANGELOG.md b/CHANGELOG.md index f900441..5d52c99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ #### 1.7.6 - Detects `dbclient` install as alternative to OpenSSH Client. (DietPi) - Attempts to install OpenSSH Client if not found, and Dropbear is not alternative. (DietPi) +- Fix bug with `dropbearkey` not finding .ssh folder #### 1.7.5 - No code changes! @@ -31,7 +32,7 @@ - Fixes `custom.list` not being processed by `./gravity-sync.sh restore` function. - Detects absence of `ssh` client command on host OS (DietPi) - Detects absence of `rsync` client command on host OS (DietPi) -- Detects absence of `ssh-keygen` utility on host OS and will use dropbearkey as an alternative (DietPi) +- Detects absence of `ssh-keygen` utility on host OS and will use `dropbearkey` as an alternative (DietPi) - Changelog polarity reversed after heated discussions with marketing team. #### 1.7.3 diff --git a/gravity-sync.sh b/gravity-sync.sh index dae84bd..a96e04c 100755 --- a/gravity-sync.sh +++ b/gravity-sync.sh @@ -929,7 +929,13 @@ function config_generate { echo -e "========================================================" echo -e "========================================================" - ssh-copy-id -f -i $HOME/${SSH_PKIF}.pub ${REMOTE_USER}@${REMOTE_HOST} + if hash ssh-copy-id 2>/dev/null + then + ssh-copy-id -f -i $HOME/${SSH_PKIF}.pub ${REMOTE_USER}@${REMOTE_HOST} + elseif hash dropbearkey 2>/dev/null + then + dropbearkey -t ecdsa -f $HOME/${SSH_PKIF} | grep "^ecdsa" > $HOME/${SSH_PKIF}.pub + cat $HOME/${SSH_PKIF}.pub | dbclient ${REMOTE_USER}@${REMOTE_HOST} 'cat - >> .ssh/authorized_keys' echo -e "========================================================" echo -e "========================================================" else