From 91d779d5e6281b4018dfaf8fbea9ff16a2fb892c Mon Sep 17 00:00:00 2001 From: Willy Sudiarto Raharjo Date: Sat, 21 Mar 2020 20:20:34 +0700 Subject: [PATCH] sqg: Use local configuration as priority. Signed-off-by: Willy Sudiarto Raharjo --- src/usr/libexec/sbopkg/sqg/functions | 7 ++++++- src/usr/sbin/sqg | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/usr/libexec/sbopkg/sqg/functions b/src/usr/libexec/sbopkg/sqg/functions index bc75f72..93e2f7e 100644 --- a/src/usr/libexec/sbopkg/sqg/functions +++ b/src/usr/libexec/sbopkg/sqg/functions @@ -12,11 +12,16 @@ SQG_TMP_DIR=${SQG_TMP_DIR:-/tmp/sqg} # - directory 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 "Check the configurable variables at the top of the script." exit 1 else + echo "Using system wide configuration in $SBOPKG_CONF" . $SBOPKG_CONF fi diff --git a/src/usr/sbin/sqg b/src/usr/sbin/sqg index ae8c92a..4b23de5 100755 --- a/src/usr/sbin/sqg +++ b/src/usr/sbin/sqg @@ -29,6 +29,7 @@ ### OPTIONAL CONFIGURATION BELOW ### +LOCAL_SBOPKG_CONF=${LOCAL_SBOPKG_CONF:-/root/.sbopkg.conf} SBOPKG_CONF=${SBOPKG_CONF:-/etc/sbopkg/sbopkg.conf} ### NO CHANGES SHOULD BE NECESSARY BELOW THIS LINE ###