forked from extern/shorewall_code
Establish default product based on $0
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
7ce5c31c68
commit
089ff4eb33
@ -4531,7 +4531,7 @@ shorewall_cli() {
|
||||
usage 1
|
||||
fi
|
||||
|
||||
setup_product_environment 1
|
||||
setup_product_environment
|
||||
|
||||
[ -n "$g_lite" ] || . ${SHAREDIR}/shorewall/lib.cli-std
|
||||
|
||||
|
@ -35,7 +35,7 @@ fatal_error() # $@ = Message
|
||||
exit 2
|
||||
}
|
||||
|
||||
setup_product_environment() { # $1 -- if non-empty, source shorewallrc
|
||||
setup_product_environment() {
|
||||
g_basedir=${SHAREDIR}/shorewall
|
||||
|
||||
g_sharedir="$SHAREDIR"/$PRODUCT
|
||||
@ -88,16 +88,32 @@ setup_product_environment() { # $1 -- if non-empty, source shorewallrc
|
||||
}
|
||||
|
||||
set_default_product() {
|
||||
if [ -f ${g_basedir}/version ]; then
|
||||
PRODUCT=shorewall
|
||||
elif [ -f ${SHAREDIR}/shorewall-lite/version ]; then
|
||||
PRODUCT=shorewall-lite
|
||||
elif [ -f ${SHAREDIR}/shorewall6-lite/version ]; then
|
||||
PRODUCT=shorewall6-lite
|
||||
else
|
||||
fatal_error "No Shorewall firewall product is installed"
|
||||
fi
|
||||
}
|
||||
case $(basename $0) in
|
||||
shorewall6)
|
||||
PRODUCT=shorewall6
|
||||
;;
|
||||
shorewall4)
|
||||
PRODUCT=shorewall
|
||||
;;
|
||||
shorewall-lite)
|
||||
PRODUCT=shorewall-lite
|
||||
;;
|
||||
shorewall6-lite)
|
||||
PRODUCT=shorewall6-lite
|
||||
;;
|
||||
*)
|
||||
if [ -f ${g_basedir}/version ]; then
|
||||
PRODUCT=shorewall
|
||||
elif [ -f ${SHAREDIR}/shorewall-lite/version ]; then
|
||||
PRODUCT=shorewall-lite
|
||||
elif [ -f ${SHAREDIR}/shorewall6-lite/version ]; then
|
||||
PRODUCT=shorewall6-lite
|
||||
else
|
||||
fatal_error "No Shorewall firewall product is installed"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Not configured Error
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user