Don't modify CONFDIR and SHAREDIR in the shell code

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep
2012-04-02 12:39:49 -07:00
parent 348c99c7d0
commit fb428bf564
9 changed files with 44 additions and 67 deletions

View File

@ -31,7 +31,6 @@
#
get_config() {
local prog
local confdir
ensure_config_path
@ -49,10 +48,7 @@ get_config() {
if [ -f $config ]; then
if [ -r $config ]; then
confdir=${CONFDIR}
CONFDIR=${g_confdir}
. $config
CONFDIR=${confdir}
else
echo "Cannot read $config! (Hint: Are you root?)" >&2
exit 1
@ -382,7 +378,7 @@ compiler() {
#
# Get the config from $g_shorewalldir
#
[ -n "$g_shorewalldir" -a "$g_shorewalldir" != /etc/$g_program ] && get_config
[ -n "$g_shorewalldir" -a "$g_shorewalldir" != ${g_confdir} ] && get_config
case $COMMAND in
*start|try|refresh)
@ -407,7 +403,7 @@ compiler() {
shorewallrc=$(find_file shorewallrc)
[ -f "$shorewallrc" ] || fatal_error "Compiling for export requires a shorewallrc file"
else
shorewallrc="${g_sharedir}/shorewall/shorewallrc"
shorewallrc="${g_basedir}/shorewallrc"
fi
options="--verbose=$VERBOSITY --family=$g_family --config_path=$CONFIG_PATH --shorewallrc=${shorewallrc}"