File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
share/github-backup-utils Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,6 @@ BACKUP_UTILS_VERSION="$(cat $GHE_BACKUP_ROOT/share/github-backup-utils/version)"
23
23
# Add the bin and share/github-backup-utils dirs to PATH
24
24
PATH=" $GHE_BACKUP_ROOT /bin:$GHE_BACKUP_ROOT /share/github-backup-utils:$PATH "
25
25
26
- # The backup config file. This may be set in the environment.
27
- : ${GHE_BACKUP_CONFIG:= " $GHE_BACKUP_ROOT /backup.config" }
28
-
29
26
# Parse out -v (verbose) argument
30
27
if [ " $1 " = " -v" ]; then
31
28
GHE_VERBOSE=true
45
42
# backup.config value when set.
46
43
GHE_HOSTNAME_PRESERVE=" $GHE_HOSTNAME "
47
44
48
- # Source in the backup config file from the local working copy location first
49
- # and then falling back to the system location .
45
+ # Source in the backup config file from the copy specified in the environment
46
+ # first and then fall back to the backup-utils root, home directory and system .
50
47
config_found=false
51
- for f in " $GHE_BACKUP_CONFIG " " /etc/github-backup-utils/backup.config" ; do
48
+ for f in " $GHE_BACKUP_CONFIG " " $GHE_BACKUP_ROOT /backup.config" \
49
+ " $HOME /.github-backup-utils/backup.config" " /etc/github-backup-utils/backup.config" ; do
52
50
if [ -f " $f " ]; then
53
51
GHE_BACKUP_CONFIG=" $f "
54
52
. " $GHE_BACKUP_CONFIG "
60
58
# Check that the config file exists before we source it in.
61
59
if ! $config_found ; then
62
60
echo " Error: No backup configuration file found. Tried:" 1>&2
63
- echo " - $GHE_BACKUP_CONFIG " 1>&2
61
+ [ -n " $GHE_BACKUP_CONFIG " ] && echo " - $GHE_BACKUP_CONFIG " 1>&2
62
+ echo " - $GHE_BACKUP_ROOT /backup.config" 1>&2
63
+ echo " - $HOME /.github-backup-utils/backup.config" 1>&2
64
64
echo " - /etc/github-backup-utils/backup.config" 1>&2
65
65
exit 2
66
66
fi
You can’t perform that action at this time.
0 commit comments