Skip to content

Commit 63990de

Browse files
xeagortomayko
authored andcommitted
Source /etc/github-backup-utils/backup.config if it exists
1 parent d3c442f commit 63990de

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

share/github-backup-utils/ghe-backup-config

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ PATH="$GHE_BACKUP_ROOT/bin:$GHE_BACKUP_ROOT/share/github-backup-utils:$PATH"
2020

2121
# The backup config file. This may be set in the environment.
2222
: ${GHE_BACKUP_CONFIG:="$GHE_BACKUP_ROOT/backup.config"}
23+
if [ ! -f $GHE_BACKUP_CONFIG ]; then
24+
GHE_BACKUP_CONFIG="/etc/github-backup-utils/backup.config"
25+
fi
2326

2427
# Parse out -v (verbose) argument
2528
if [ "$1" = "-v" ]; then
@@ -38,7 +41,9 @@ fi
3841

3942
# Check that the config file exists before we source it in.
4043
if [ ! -f "$GHE_BACKUP_CONFIG" ]; then
41-
echo "Error: The backup config file ('$GHE_BACKUP_CONFIG') doesn't exist." 1>&2
44+
echo "Error: No backup configuration file found. Tried:"
45+
echo " - $GHE_BACKUP_ROOT/backup.config"
46+
echo " - /etc/github-backup-utils/backup.config"
4247
exit 2
4348
fi
4449

0 commit comments

Comments
 (0)