From 9705fa78dc9f004cb38a2e4a2d413eb42b0bbff3 Mon Sep 17 00:00:00 2001 From: Janek Bevendorff Date: Sun, 5 Oct 2014 18:51:48 +0200 Subject: [PATCH] Do not overwrite any existing global rsnapshot config --- install.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 6d1f1dc..bb8c82b 100755 --- a/install.sh +++ b/install.sh @@ -139,10 +139,13 @@ if [[ $MODE == "install" ]]; then $MKDIR "$BKP_DIR"/usr/share/perl5 fi - $CP ./server/bkp/etc/* "$BKP_DIR"/etc/ - # Correct command paths in rsnapshot config for Synology DSM - if [[ "$DISTRIBUTION" == "Synology" ]]; then - sed -i "s#/usr/bin/\(cp\|rm\|rsync\|logger\)\$#/opt/bin/\1#" "$BKP_DIR"/etc/rsnapshot.global.conf + # Do not overwrite existing config + if [ ! -e "$BKP_DIR"/etc/rsnapshot.global.conf ]; then + $CP ./server/bkp/etc/* "$BKP_DIR"/etc/ + # Correct command paths in rsnapshot config for Synology DSM + if [[ "$DISTRIBUTION" == "Synology" ]]; then + sed -i "s#/usr/bin/\(cp\|rm\|rsync\|logger\)\$#/opt/bin/\1#" "$BKP_DIR"/etc/rsnapshot.global.conf + fi fi # Create symlink for chroot