Skip to content

Commit 3a3b6a7

Browse files
committed
btrfs-sync: check for existing keys
Signed-off-by: nachoparker <nacho@ownyourbits.com>
1 parent 6cb682a commit 3a3b6a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/ncp/BACKUPS/nc-snapshot-sync.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ install()
1515
apt-get install -y --no-install-recommends pv openssh-client
1616
wget https://raw.githubusercontent.com/nachoparker/btrfs-sync/master/btrfs-sync -O /usr/local/bin/btrfs-sync
1717
chmod +x /usr/local/bin/btrfs-sync
18-
ssh-keygen -N "" -f /root/.ssh/id_rsa
18+
if ! [[ -f /root/.ssh/id_rsa ]]; then ssh-keygen -N "" -f /root/.ssh/id_rsa; fi
1919
}
2020

2121
configure()
2222
{
23-
[[ $ACTIVE != "yes" ]] && {
23+
[[ $ACTIVE != "yes" ]] && {
2424
rm -f /etc/cron.d/ncp-snapsync-auto
2525
service cron restart
2626
echo "snapshot sync disabled"

0 commit comments

Comments
 (0)