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 require $var
done done
[ -n "$SANDBOX" ] && configure=0
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin
if [ -z "$BUILD" ]; then if [ -z "$BUILD" ]; then

View File

@ -151,22 +151,29 @@ fi
echo "Uninstalling Shorewall Init $VERSION" echo "Uninstalling Shorewall Init $VERSION"
[ -n "$SANDBOX" ] && configure=0
INITSCRIPT=${CONFDIR}/init.d/shorewall-init INITSCRIPT=${CONFDIR}/init.d/shorewall-init
if [ -f "$INITSCRIPT" ]; then if [ -f "$INITSCRIPT" ]; then
if mywhich updaterc.d ; then if [ $configure -eq 1 ]; then
updaterc.d shorewall-init remove if mywhich updaterc.d ; then
elif mywhich insserv ; then updaterc.d shorewall-init remove
insserv -r $INITSCRIPT elif mywhich insserv ; then
elif mywhich chkconfig ; then insserv -r $INITSCRIPT
chkconfig --del $(basename $INITSCRIPT) elif mywhich chkconfig ; then
elif mywhich systemctl ; then chkconfig --del $(basename $INITSCRIPT)
systemctl disable shorewall-init fi
fi fi
remove_file $INITSCRIPT remove_file $INITSCRIPT
fi 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}/ifup-local)" = ${SHAREDIR}/shorewall-init ] && remove_file ${SBINDIR}/ifup-local
[ "$(readlink -m -q ${SBINDIR}/ifdown-local)" = ${SHAREDIR}/shorewall-init ] && remove_file ${SBINDIR}/ifdown-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} PATH=${SBINDIR}:/bin:/usr${SBINDIR}:/usr/bin:/usr/local/bin:/usr/local${SBINDIR}
[ -n "$SANDBOX" ] && configure=0
# #
# Determine where to install the firewall script # Determine where to install the firewall script
# #

View File

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

View File

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

View File

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