]> arthur.barton.de Git - backup-script.git/commitdiff
backup-status: Use same configuration search order than backup-script
authorAlexander Barton <alex@barton.de>
Tue, 18 Aug 2015 10:23:50 +0000 (12:23 +0200)
committerAlexander Barton <alex@barton.de>
Tue, 18 Aug 2015 10:23:50 +0000 (12:23 +0200)
bin/backup-status

index 4a181801b21537f700ee677932c568a888f4101b..13c651c7d75bd104c2d778b03ad8c7f267da4551 100755 (executable)
@@ -19,13 +19,22 @@ declare -i count=0
 declare -i snapshots=0
 
 # Default settings, can be overwritten in backup-script.conf:
-conf_d="/etc/backup-script.d"
+[ -d "/usr/local/etc/backup-script.d" ] \
+       && conf_d="/usr/local/etc/backup-script.d" \
+       || conf_d="/etc/backup-script.d"
 default_target=""
 default_generations=0
 
-for conf in "/etc/backup-script.conf" "${conf_d}/backup-script.conf"; do
+# Search configuration file (last one is used as default!)
+for conf in \
+       "/usr/local/etc/backup-script.conf" \
+       "/etc/backup-script.conf" \
+       "${conf_d}/backup-script.conf" \
+       "/usr/local/etc/backup-script.conf" \
+; do
        if [ -r "$conf" ]; then
                source "$conf"
+               break
        fi
 done