]> arthur.barton.de Git - backup-script.git/commitdiff
Allow overriding of "system" variable
authorAlexander Barton <alex@barton.de>
Thu, 26 Sep 2013 15:44:40 +0000 (17:44 +0200)
committerAlexander Barton <alex@barton.de>
Thu, 26 Sep 2013 15:44:40 +0000 (17:44 +0200)
bin/backup-script

index 11208c22ccd4f6a0f593937fbec35b35ba9b4140..e57673a0461b112a71d237af030056f3a5ee0f68 100755 (executable)
@@ -139,14 +139,15 @@ fi
 for f in $sys; do
        [ -r "$f" -a -f "$f" ] || continue
 
-       system=`basename $f`
-       case "$system" in
+       fname=`basename $f`
+       case "$fname" in
                "backup-script.conf"|*.sh)
                        continue
                        ;;
        esac
 
        # Set global defaults
+       system="$fname"
        user="$default_user"
        target="$default_target"
        ssh_args_add="$default_ssh_args_add"
@@ -159,9 +160,12 @@ for f in $sys; do
        # Read in system configuration file
        source "$f"
 
+       [ "$system" = "$fname" ] \
+               && systxt="\"$system\"" \
+               || systxt="\"$fname\" [\"$system\"]"
        [ "$local" -eq 0 ] \
-               && echo "Working on \"$system\" ..." \
-               || echo "Working on \"$system\" (local system) ..."
+               && echo "Working on $systxt ..." \
+               || echo "Working on $sytxts (local system) ..."
 
        count_all=$count_all+1