From a4451e82accdf514eb866e64a35d14c6c2df245a Mon Sep 17 00:00:00 2001 From: Paul Lietar Date: Sat, 30 Nov 2013 02:45:58 +0000 Subject: [PATCH] Merge ssh keys rather than overwriting them. --- plugins/00_dokku-standard/backup-import | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/00_dokku-standard/backup-import b/plugins/00_dokku-standard/backup-import index 076c0e930..86404a99b 100755 --- a/plugins/00_dokku-standard/backup-import +++ b/plugins/00_dokku-standard/backup-import @@ -6,8 +6,8 @@ TARGET_DIR="$3" [[ -f $IMPORT_DIR/.sshcommand ]] && mv $IMPORT_DIR/.sshcommand $TARGET_DIR/.sshcommand if [[ -f $IMPORT_DIR/.ssh/authorized_keys ]]; then - mkdir $TARGET_DIR/.ssh - mv $IMPORT_DIR/.ssh/authorized_keys $TARGET_DIR/.ssh/authorized_keys + mkdir -p $TARGET_DIR/.ssh + cat $IMPORT_DIR/.ssh/authorized_keys $TARGET_DIR/.ssh/authorized_keys | uniq > $TARGET_DIR/.ssh/authorized_keys chmod 0700 $TARGET_DIR/.ssh chmod 0600 $TARGET_DIR/.ssh/* fi