More uninstall corrections.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2014-10-04 09:39:03 -07:00
parent 2fce05b3ab
commit 9dc2bba025
4 changed files with 120 additions and 25 deletions

View File

@ -27,6 +27,7 @@
# shown below. Simply run this script to remove Shorewall Firewall
VERSION=xxx #The Build script inserts the actual version
PRODUCT=shorewall-lite
usage() # $1 = exit status
{
@ -182,17 +183,15 @@ fi
if [ -n "$SYSTEMD" ]; then
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}
rm -f $SYSTEMD/${PRODUCT}.service
rm -f $SYSTEMD/shorewall-lite.service
fi
rm -f ${SBINDIR}/shorewall-lite
rm -rf ${SBINDIR}/shorewall-lite
rm -rf ${VARDIR}/shorewall-lite
rm -rf ${SHAREDIR}/shorewall-lite
rm -rf ${LIBEXEC}/shorewall-lite
rm -f ${CONFDIR}/logrotate.d/shorewall-lite
[ -n "$SYSTEMD" ] && rm -f ${SYSTEMD}/shorewall-lite.service
echo "Shorewall Lite Uninstalled"

View File

@ -27,6 +27,7 @@
# shown below. Simply run this script to remove Shorewall Firewall
VERSION=xxx #The Build script inserts the actual version
PRODUCT=shorewall
usage() # $1 = exit status
{
@ -177,7 +178,7 @@ fi
if [ -n "$SYSTEMD" ]; then
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}
rm -f $SYSTEMD/${PRODUCT}.service
rm -f $SYSTEMD/shorewall.service
fi
rm -rf ${SHAREDIR}/shorewall/version
@ -189,7 +190,7 @@ if [ -n "$SYSCONFDIR" ]; then
fi
rm -rf ${VARDIR}/shorewall
rm -rf ${PERLLIB}/Shorewall/*
rm -rf ${PERLLIBDIR}/Shorewall/*
rm -rf ${LIBEXEC}/shorewall
rm -rf ${SHAREDIR}/shorewall/configfiles/
rm -rf ${SHAREDIR}/shorewall/Samples/

View File

@ -27,6 +27,7 @@
# shown below. Simply run this script to remove Shorewall Firewall
VERSION=xxx #The Build script inserts the actual version
PRODUCT=shorewall6-lite
usage() # $1 = exit status
{
@ -69,6 +70,42 @@ remove_file() # $1 = file to restore
fi
}
finished=0
configure=1
while [ $finished -eq 0 ]; do
option=$1
case "$option" in
-*)
option=${option#-}
while [ -n "$option" ]; do
case $option in
h)
usage 0
;;
v)
echo "$Product Firewall Installer Version $VERSION"
exit 0
;;
n*)
configure=0
option=${option#n}
;;
*)
usage 1
;;
esac
done
shift
;;
*)
finished=1
;;
esac
done
#
# Read the RC file
#
@ -112,8 +149,12 @@ fi
echo "Uninstalling Shorewall Lite $VERSION"
if qt ip6tables -L shorewall -n && [ ! -f ${SBINDIR)/shorewall6 ]; then
${SBINDIR}/shorewall6-lite clear
[ -n "$SANDBOX" ] && configure=0
if [ $configure -eq 1 ]; then
if qt ip6tables -L shorewall -n && [ ! -f ${SBINDIR)/shorewall6 ]; then
${SBINDIR}/shorewall6-lite clear
fi
fi
if [ -l ${SHAREDIR}/shorewall6-lite/init ]; then
@ -123,19 +164,26 @@ elif [ -n "$INITFILE" ]; then
fi
if [ -f "$FIREWALL" ]; then
if mywhich updaterc.d ; then
updaterc.d shorewall6-lite remove
elif mywhich insserv ; then
insserv -r $FIREWALL
elif mywhich chkconfig ; then
chkconfig --del $(basename $FIREWALL)
elif mywhich systemctl ; then
systemctl disable shorewall6-lite
if [ $configure -eq 1 ]; then
if mywhich updaterc.d ; then
updaterc.d shorewall6-lite remove
elif mywhich insserv ; then
insserv -r $FIREWALL
elif mywhich chkconfig ; then
chkconfig --del $(basename $FIREWALL)
elif mywhich systemctl ; then
systemctl disable shorewall6-lite
fi
fi
remove_file $FIREWALL
fi
if [ -n "$SYSTEMD" ]; then
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}
rm -f $SYSTEMD/shorewall6-lite.service
fi
rm -f ${SBINDIR}/shorewall6-lite
rm -rf ${CONFDIR}/shorewall6-lite
rm -rf ${VARDIR}/shorewall6-lite

View File

@ -27,6 +27,7 @@
# shown below. Simply run this script to remove Shorewall Firewall
VERSION=xxx #The Build script inserts the actual version
PRODUCT=shorewall6
usage() # $1 = exit status
{
@ -69,6 +70,43 @@ remove_file() # $1 = file to restore
fi
}
finished=0
configure=1
while [ $finished -eq 0 ]; do
option=$1
case "$option" in
-*)
option=${option#-}
while [ -n "$option" ]; do
case $option in
h)
usage 0
;;
v)
echo "$Product Firewall Installer Version $VERSION"
exit 0
;;
n*)
configure=0
option=${option#n}
;;
*)
usage 1
;;
esac
done
shift
;;
*)
finished=1
;;
esac
done
#
# Read the RC file
#
@ -112,8 +150,12 @@ fi
echo "Uninstalling shorewall6 $VERSION"
if qt ip6tables -L shorewall6 -n && [ ! -f ${SBINDIR}/shorewall6-lite ]; then
${SBINDIR}/shorewall6 clear
[ -n "$SANDBOX" ] && configure=0
if [ $configure -eq 1 ]; then
if qt ip6tables -L shorewall6 -n && [ ! -f ${SBINDIR}/shorewall6-lite ]; then
${SBINDIR}/shorewall6 clear
fi
fi
if [ -L ${SHAREDIR}/shorewall6/init ]; then
@ -123,19 +165,24 @@ elif [ -n "$INITFILE" ]; then
fi
if [ -f "$FIREWALL" ]; then
if mywhich updaterc.d ; then
updaterc.d shorewall6 remove
elif mywhich insserv ; then
insserv -r $FIREWALL
elif mywhich chkconfig ; then
chkconfig --del $(basename $FIREWALL)
elif mywhich systemctl ; then
systemctl disable shorewall6
if [ $configure -eq 1 ]; then
if mywhich updaterc.d ; then
updaterc.d shorewall6 remove
elif mywhich insserv ; then
insserv -r $FIREWALL
elif mywhich chkconfig ; then
chkconfig --del $(basename $FIREWALL)
fi
fi
remove_file $FIREWALL
fi
if [ -n "$SYSTEMD" ]; then
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}
rm -f $SYSTEMD/shorewall6.service
fi
rm -f ${SBINDIR}/shorewall6
rm -rf ${CONFDIR}/shorewall6
rm -rf ${VARDIR}/shorewall6