diff --git a/helper/build_config b/helper/build_config index f426bf99..525ddf87 100755 --- a/helper/build_config +++ b/helper/build_config @@ -12,19 +12,10 @@ if [ "${#:-}" -ne 1 ] ; then exit 1 fi -if [ -z "${CONFIG_POOL:-}" ] ; then - echo "Error: $CONFIG_POOL is not set." >&2 - exit 1 -fi - -# support for testsuite -if [ -z "${FUNCTIONS:-}" ] ; then - FUNCTIONS='/usr/share/ngcp-ngcpcfg/functions/' -fi - -if [ -z "${HELPER:-}" ] ; then - HELPER='/usr/share/ngcp-ngcpcfg/helper/' -fi +# support for testsuite, assume defaults if unset +CONFIG_POOL="${CONFIG_POOL:-/etc}" +FUNCTIONS="${FUNCTIONS:-/usr/share/ngcp-ngcpcfg/functions/}" +HELPER="${HELPER:-/usr/share/ngcp-ngcpcfg/helper/}" . ${FUNCTIONS}/main diff --git a/sbin/ngcpcfg b/sbin/ngcpcfg index d2b5efaf..b31ad0f3 100755 --- a/sbin/ngcpcfg +++ b/sbin/ngcpcfg @@ -6,13 +6,8 @@ set -e set -u # support for testsuite -if [ -z "${FUNCTIONS:-}" ] ; then - FUNCTIONS='/usr/share/ngcp-ngcpcfg/functions/' -fi - -if [ -z "${SCRIPTS:-}" ] ; then - SCRIPTS='/usr/share/ngcp-ngcpcfg/scripts/' -fi +FUNCTIONS="${FUNCTIONS:-/usr/share/ngcp-ngcpcfg/functions/}" +SCRIPTS="${SCRIPTS:-/usr/share/ngcp-ngcpcfg/scripts/}" if ! [ -r "${FUNCTIONS}/main" ] ; then printf "Error: ${FUNCTIONS}/main could not be read. Exiting.\n" >&2 diff --git a/scripts/build b/scripts/build index 4343de0d..bddd3259 100755 --- a/scripts/build +++ b/scripts/build @@ -7,13 +7,8 @@ set -e set -u # support testsuite -if [ -z "${FUNCTIONS:-}" ] ; then - FUNCTIONS='/usr/share/ngcp-ngcpcfg/functions/' -fi - -if [ -z "${HELPER:-}" ] ; then - HELPER='/usr/share/ngcp-ngcpcfg/helper/' -fi +FUNCTIONS="${FUNCTIONS:-/usr/share/ngcp-ngcpcfg/functions/}" +HELPER="${HELPER:-/usr/share/ngcp-ngcpcfg/helper/}" if ! [ -r ${FUNCTIONS}/main ] ; then printf "Error: ${FUNCTIONS}/main could not be read. Exiting.\n" >&2 diff --git a/scripts/commit b/scripts/commit index 682068aa..d389efa6 100755 --- a/scripts/commit +++ b/scripts/commit @@ -12,10 +12,7 @@ fi . /usr/share/ngcp-ngcpcfg/functions/main -if [ -z "${HELPER:-}" ] ; then - HELPER='/usr/share/ngcp-ngcpcfg/helper/' -fi - +HELPER="${HELPER:-/usr/share/ngcp-ngcpcfg/helper/}" # main script cd "$NGCPCTL_MAIN" diff --git a/scripts/encrypt b/scripts/encrypt index f43d0ebb..1a7f7037 100755 --- a/scripts/encrypt +++ b/scripts/encrypt @@ -6,13 +6,8 @@ set -e set -u # support testsuite -if [ -z "${FUNCTIONS:-}" ] ; then - FUNCTIONS='/usr/share/ngcp-ngcpcfg/functions/' -fi - -if [ -z "${HELPER:-}" ] ; then - HELPER='/usr/share/ngcp-ngcpcfg/helper/' -fi +FUNCTIONS="${FUNCTIONS:-/usr/share/ngcp-ngcpcfg/functions/}" +HELPER="${HELPER:-/usr/share/ngcp-ngcpcfg/helper/}" if ! [ -r ${FUNCTIONS}/main ] ; then printf "Error: ${FUNCTIONS}/main could not be read. Exiting.\n" >&2