sqg: Use local configuration as priority.

Signed-off-by: Willy Sudiarto Raharjo <willysr@sbopkg.org>
This commit is contained in:
Willy Sudiarto Raharjo 2020-03-21 20:20:34 +07:00
parent c766b3d1ab
commit 91d779d5e6
No known key found for this signature in database
GPG Key ID: 887B8374D7333381
2 changed files with 7 additions and 1 deletions

View File

@ -12,11 +12,16 @@ SQG_TMP_DIR=${SQG_TMP_DIR:-/tmp/sqg}
# - directory checks # - directory checks
# #
sanity_checks () { sanity_checks () {
if [ ! -e "$SBOPKG_CONF" ]; then # if local configuration exist, we will use it first
if [ -e "$LOCAL_SBOPKG_CONF" ]; then
echo "Using local configuration in $LOCAL_SBOPKG_CONF"
. $LOCAL_SBOPKG_CONF
elif [ ! -e "$SBOPKG_CONF" ]; then
echo "$SBOPKG_CONF not found." echo "$SBOPKG_CONF not found."
echo "Check the configurable variables at the top of the script." echo "Check the configurable variables at the top of the script."
exit 1 exit 1
else else
echo "Using system wide configuration in $SBOPKG_CONF"
. $SBOPKG_CONF . $SBOPKG_CONF
fi fi

View File

@ -29,6 +29,7 @@
### OPTIONAL CONFIGURATION BELOW ### ### OPTIONAL CONFIGURATION BELOW ###
LOCAL_SBOPKG_CONF=${LOCAL_SBOPKG_CONF:-/root/.sbopkg.conf}
SBOPKG_CONF=${SBOPKG_CONF:-/etc/sbopkg/sbopkg.conf} SBOPKG_CONF=${SBOPKG_CONF:-/etc/sbopkg/sbopkg.conf}
### NO CHANGES SHOULD BE NECESSARY BELOW THIS LINE ### ### NO CHANGES SHOULD BE NECESSARY BELOW THIS LINE ###