From 3a3b6a7042b78a7d48cd139ac0f2e1420666a8b2 Mon Sep 17 00:00:00 2001 From: nachoparker Date: Sun, 17 Jan 2021 16:50:32 -0700 Subject: btrfs-sync: check for existing keys Signed-off-by: nachoparker --- bin/ncp/BACKUPS/nc-snapshot-sync.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/ncp/BACKUPS/nc-snapshot-sync.sh b/bin/ncp/BACKUPS/nc-snapshot-sync.sh index 79a11d8a..2f965bd4 100644 --- a/bin/ncp/BACKUPS/nc-snapshot-sync.sh +++ b/bin/ncp/BACKUPS/nc-snapshot-sync.sh @@ -15,12 +15,12 @@ install() apt-get install -y --no-install-recommends pv openssh-client wget https://raw.githubusercontent.com/nachoparker/btrfs-sync/master/btrfs-sync -O /usr/local/bin/btrfs-sync chmod +x /usr/local/bin/btrfs-sync - ssh-keygen -N "" -f /root/.ssh/id_rsa + if ! [[ -f /root/.ssh/id_rsa ]]; then ssh-keygen -N "" -f /root/.ssh/id_rsa; fi } configure() { - [[ $ACTIVE != "yes" ]] && { + [[ $ACTIVE != "yes" ]] && { rm -f /etc/cron.d/ncp-snapsync-auto service cron restart echo "snapshot sync disabled" -- cgit v1.2.3