Implement SANDBOX variable in the installers/uninstallers

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2014-10-04 07:50:30 -07:00
parent f9a21bd90e
commit 00b0489047
6 changed files with 35 additions and 12 deletions

View File

@ -184,6 +184,8 @@ for var in SHAREDIR LIBEXECDIR CONFDIR SBINDIR VARLIB VARDIR; do
require $var
done
[ -n "$SANDBOX" ] && configure=0
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
if [ -z "$BUILD" ]; then

View File

@ -151,22 +151,29 @@ fi
echo "Uninstalling Shorewall Init $VERSION"
[ -n "$SANDBOX" ] && configure=0
INITSCRIPT=${CONFDIR}/init.d/shorewall-init
if [ -f "$INITSCRIPT" ]; then
if [ $configure -eq 1 ]; then
if mywhich updaterc.d ; then
updaterc.d shorewall-init remove
elif mywhich insserv ; then
insserv -r $INITSCRIPT
elif mywhich chkconfig ; then
chkconfig --del $(basename $INITSCRIPT)
elif mywhich systemctl ; then
systemctl disable shorewall-init
fi
fi
remove_file $INITSCRIPT
fi
if [ -n "$SYSTEMD" ]; then
[ $configure -eq 1 ] && systemctl disable shorewall-init.service
rm -f $SYSTEMD/shorewall-init.service
fi
[ "$(readlink -m -q ${SBINDIR}/ifup-local)" = ${SHAREDIR}/shorewall-init ] && remove_file ${SBINDIR}/ifup-local
[ "$(readlink -m -q ${SBINDIR}/ifdown-local)" = ${SHAREDIR}/shorewall-init ] && remove_file ${SBINDIR}/ifdown-local

View File

@ -195,6 +195,8 @@ done
PATH=${SBINDIR}:/bin:/usr${SBINDIR}:/usr/bin:/usr/local/bin:/usr/local${SBINDIR}
[ -n "$SANDBOX" ] && configure=0
#
# Determine where to install the firewall script
#

View File

@ -153,6 +153,8 @@ fi
echo "Uninstalling Shorewall Lite $VERSION"
[ -n "$SANDBOX" ] && configure=0
if qt iptables -L shorewall -n && [ ! -f ${SBINDIR}/shorewall ]; then
shorewall-lite clear
fi
@ -171,14 +173,17 @@ if [ -f "$FIREWALL" ]; then
insserv -r $FIREWALL
elif mywhich chkconfig ; then
chkconfig --del $(basename $FIREWALL)
elif mywhich systemctl ; then
systemctl disable shorewall-lite
fi
fi
remove_file $FIREWALL
fi
if [ -n "$SYSTEMD" ]; then
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}
rm -f $SYSTEMD/${PRODUCT}.service
fi
rm -f ${SBINDIR}/shorewall-lite
rm -rf ${SBINDIR}/shorewall-lite

View File

@ -209,6 +209,8 @@ done
[ -n "${INITFILE}" ] && require INITSOURCE && require INITDIR
[ -n "$SANDBOX" ] && configure=0
if [ -z "$BUILD" ]; then
case $(uname) in
cygwin*|CYGWIN*)

View File

@ -152,6 +152,8 @@ fi
echo "Uninstalling shorewall $VERSION"
[ -n "$SANDBOX" ] && configure=0
if qt iptables -L shorewall -n && [ ! -f ${SBINDIR}/shorewall-lite ]; then
shorewall clear
fi
@ -166,14 +168,17 @@ if [ -f "$INITSCRIPT" ]; then
insserv -r $INITSCRIPT
elif mywhich chkconfig ; then
chkconfig --del $(basename $INITSCRIPT)
elif mywhich systemctl ; then
systemctl disable ${PRODUCT}
fi
fi
remove_file $INITSCRIPT
fi
if [ -n "$SYSTEMD" ]; then
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}
rm -f $SYSTEMD/${PRODUCT}.service
fi
rm -rf ${SHAREDIR}/shorewall/version
rm -rf ${CONFDIR}/shorewall