From 935ea48dc92d1f7ff0439b5ab6f18e0cf76d9409 Mon Sep 17 00:00:00 2001 From: Alexander Barton Date: Tue, 18 Aug 2015 12:23:50 +0200 Subject: [PATCH] backup-status: Use same configuration search order than backup-script --- bin/backup-status | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bin/backup-status b/bin/backup-status index 4a18180..13c651c 100755 --- a/bin/backup-status +++ b/bin/backup-status @@ -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 -- 2.39.2