Simplify default configuration code

sync-replication
Michael Prokop 12 years ago
parent c3e1cb68d4
commit 928cd68cf2

@ -12,19 +12,10 @@ if [ "${#:-}" -ne 1 ] ; then
exit 1 exit 1
fi fi
if [ -z "${CONFIG_POOL:-}" ] ; then # support for testsuite, assume defaults if unset
echo "Error: $CONFIG_POOL is not set." >&2 CONFIG_POOL="${CONFIG_POOL:-/etc}"
exit 1 FUNCTIONS="${FUNCTIONS:-/usr/share/ngcp-ngcpcfg/functions/}"
fi HELPER="${HELPER:-/usr/share/ngcp-ngcpcfg/helper/}"
# 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
. ${FUNCTIONS}/main . ${FUNCTIONS}/main

@ -6,13 +6,8 @@ set -e
set -u set -u
# support for testsuite # support for testsuite
if [ -z "${FUNCTIONS:-}" ] ; then FUNCTIONS="${FUNCTIONS:-/usr/share/ngcp-ngcpcfg/functions/}"
FUNCTIONS='/usr/share/ngcp-ngcpcfg/functions/' SCRIPTS="${SCRIPTS:-/usr/share/ngcp-ngcpcfg/scripts/}"
fi
if [ -z "${SCRIPTS:-}" ] ; then
SCRIPTS='/usr/share/ngcp-ngcpcfg/scripts/'
fi
if ! [ -r "${FUNCTIONS}/main" ] ; then if ! [ -r "${FUNCTIONS}/main" ] ; then
printf "Error: ${FUNCTIONS}/main could not be read. Exiting.\n" >&2 printf "Error: ${FUNCTIONS}/main could not be read. Exiting.\n" >&2

@ -7,13 +7,8 @@ set -e
set -u set -u
# support testsuite # support testsuite
if [ -z "${FUNCTIONS:-}" ] ; then FUNCTIONS="${FUNCTIONS:-/usr/share/ngcp-ngcpcfg/functions/}"
FUNCTIONS='/usr/share/ngcp-ngcpcfg/functions/' HELPER="${HELPER:-/usr/share/ngcp-ngcpcfg/helper/}"
fi
if [ -z "${HELPER:-}" ] ; then
HELPER='/usr/share/ngcp-ngcpcfg/helper/'
fi
if ! [ -r ${FUNCTIONS}/main ] ; then if ! [ -r ${FUNCTIONS}/main ] ; then
printf "Error: ${FUNCTIONS}/main could not be read. Exiting.\n" >&2 printf "Error: ${FUNCTIONS}/main could not be read. Exiting.\n" >&2

@ -12,10 +12,7 @@ fi
. /usr/share/ngcp-ngcpcfg/functions/main . /usr/share/ngcp-ngcpcfg/functions/main
if [ -z "${HELPER:-}" ] ; then HELPER="${HELPER:-/usr/share/ngcp-ngcpcfg/helper/}"
HELPER='/usr/share/ngcp-ngcpcfg/helper/'
fi
# main script # main script
cd "$NGCPCTL_MAIN" cd "$NGCPCTL_MAIN"

@ -6,13 +6,8 @@ set -e
set -u set -u
# support testsuite # support testsuite
if [ -z "${FUNCTIONS:-}" ] ; then FUNCTIONS="${FUNCTIONS:-/usr/share/ngcp-ngcpcfg/functions/}"
FUNCTIONS='/usr/share/ngcp-ngcpcfg/functions/' HELPER="${HELPER:-/usr/share/ngcp-ngcpcfg/helper/}"
fi
if [ -z "${HELPER:-}" ] ; then
HELPER='/usr/share/ngcp-ngcpcfg/helper/'
fi
if ! [ -r ${FUNCTIONS}/main ] ; then if ! [ -r ${FUNCTIONS}/main ] ; then
printf "Error: ${FUNCTIONS}/main could not be read. Exiting.\n" >&2 printf "Error: ${FUNCTIONS}/main could not be read. Exiting.\n" >&2

Loading…
Cancel
Save