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
|
usage 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setup_product_environment 1
|
setup_product_environment
|
||||||
|
|
||||||
[ -n "$g_lite" ] || . ${SHAREDIR}/shorewall/lib.cli-std
|
[ -n "$g_lite" ] || . ${SHAREDIR}/shorewall/lib.cli-std
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ fatal_error() # $@ = Message
|
|||||||
exit 2
|
exit 2
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_product_environment() { # $1 -- if non-empty, source shorewallrc
|
setup_product_environment() {
|
||||||
g_basedir=${SHAREDIR}/shorewall
|
g_basedir=${SHAREDIR}/shorewall
|
||||||
|
|
||||||
g_sharedir="$SHAREDIR"/$PRODUCT
|
g_sharedir="$SHAREDIR"/$PRODUCT
|
||||||
@ -88,15 +88,31 @@ setup_product_environment() { # $1 -- if non-empty, source shorewallrc
|
|||||||
}
|
}
|
||||||
|
|
||||||
set_default_product() {
|
set_default_product() {
|
||||||
if [ -f ${g_basedir}/version ]; then
|
case $(basename $0) in
|
||||||
PRODUCT=shorewall
|
shorewall6)
|
||||||
elif [ -f ${SHAREDIR}/shorewall-lite/version ]; then
|
PRODUCT=shorewall6
|
||||||
PRODUCT=shorewall-lite
|
;;
|
||||||
elif [ -f ${SHAREDIR}/shorewall6-lite/version ]; then
|
shorewall4)
|
||||||
PRODUCT=shorewall6-lite
|
PRODUCT=shorewall
|
||||||
else
|
;;
|
||||||
fatal_error "No Shorewall firewall product is installed"
|
shorewall-lite)
|
||||||
fi
|
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
|
# Not configured Error
|
||||||
|
Loading…
Reference in New Issue
Block a user