mirror of
https://gitlab.com/shorewall/code.git
synced 2024-11-22 07:33:43 +01:00
Unify the uninstallers
- Clean up code - Use the .service suffix Signed-off-by: Matt Darfeuille <matdarf@gmail.com> Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
f48b2e715f
commit
c58efe7698
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Script to back uninstall Shoreline Firewall
|
# Script to back uninstall Shoreline Firewall Core Modules
|
||||||
#
|
#
|
||||||
# (c) 2000-2016 - Tom Eastep (teastep@shorewall.net)
|
# (c) 2000-2016 - Tom Eastep (teastep@shorewall.net)
|
||||||
#
|
#
|
||||||
@ -26,14 +26,17 @@
|
|||||||
# You may only use this script to uninstall the version
|
# You may only use this script to uninstall the version
|
||||||
# shown below. Simply run this script to remove Shorewall Firewall
|
# shown below. Simply run this script to remove Shorewall Firewall
|
||||||
|
|
||||||
VERSION=xxx #The Build script inserts the actual version
|
VERSION=xxx # The Build script inserts the actual version
|
||||||
PRODUCT="shorewall-core"
|
PRODUCT=shorewall-core
|
||||||
Product="Shorewall Core"
|
Product="Shorewall Core"
|
||||||
|
|
||||||
usage() # $1 = exit status
|
usage() # $1 = exit status
|
||||||
{
|
{
|
||||||
ME=$(basename $0)
|
ME=$(basename $0)
|
||||||
echo "usage: $ME [ <shorewallrc file> ]"
|
echo "usage: $ME [ <option> ] [ <shorewallrc file> ]"
|
||||||
|
echo "where <option> is one of"
|
||||||
|
echo " -h"
|
||||||
|
echo " -v"
|
||||||
exit $1
|
exit $1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,6 +50,41 @@ cd "$(dirname $0)"
|
|||||||
#
|
#
|
||||||
. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2; exit 1; }
|
. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2; exit 1; }
|
||||||
|
|
||||||
|
#
|
||||||
|
# Parse the run line
|
||||||
|
#
|
||||||
|
finished=0
|
||||||
|
|
||||||
|
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 Uninstaller Version $VERSION"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
usage 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
finished=1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
#
|
#
|
||||||
# Read the RC file
|
# Read the RC file
|
||||||
#
|
#
|
||||||
@ -92,6 +130,7 @@ echo "Uninstalling $Product $VERSION"
|
|||||||
rm -rf ${SHAREDIR}/shorewall
|
rm -rf ${SHAREDIR}/shorewall
|
||||||
rm -f ~/.shorewallrc
|
rm -f ~/.shorewallrc
|
||||||
|
|
||||||
echo "$Product Uninstalled"
|
#
|
||||||
|
# Report Success
|
||||||
|
#
|
||||||
|
echo "$Product $VERSION Uninstalled"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Script to back uninstall Shoreline Firewall
|
# Script to back uninstall Shoreline Firewall Init
|
||||||
#
|
#
|
||||||
# (c) 2000-2016 - Tom Eastep (teastep@shorewall.net)
|
# (c) 2000-2016 - Tom Eastep (teastep@shorewall.net)
|
||||||
#
|
#
|
||||||
@ -26,14 +26,18 @@
|
|||||||
# You may only use this script to uninstall the version
|
# You may only use this script to uninstall the version
|
||||||
# shown below. Simply run this script to remove Shorewall Firewall
|
# shown below. Simply run this script to remove Shorewall Firewall
|
||||||
|
|
||||||
VERSION=xxx #The Build script inserts the actual version
|
VERSION=xxx # The Build script inserts the actual version
|
||||||
PRODUCT=shorewall-init
|
PRODUCT=shorewall-init
|
||||||
Product="Shorewall Init"
|
Product="Shorewall Init"
|
||||||
|
|
||||||
usage() # $1 = exit status
|
usage() # $1 = exit status
|
||||||
{
|
{
|
||||||
ME=$(basename $0)
|
ME=$(basename $0)
|
||||||
echo "usage: $ME [ <shorewallrc file> ]"
|
echo "usage: $ME [ <option> ] [ <shorewallrc file> ]"
|
||||||
|
echo "where <option> is one of"
|
||||||
|
echo " -h"
|
||||||
|
echo " -v"
|
||||||
|
echo " -n"
|
||||||
exit $1
|
exit $1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,6 +51,9 @@ cd "$(dirname $0)"
|
|||||||
#
|
#
|
||||||
. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2; exit 1; }
|
. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2; exit 1; }
|
||||||
|
|
||||||
|
#
|
||||||
|
# Parse the run line
|
||||||
|
#
|
||||||
finished=0
|
finished=0
|
||||||
configure=1
|
configure=1
|
||||||
|
|
||||||
@ -124,35 +131,35 @@ else
|
|||||||
VERSION=""
|
VERSION=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -n "${LIBEXEC:=${SHAREDIR}}" ]
|
|
||||||
|
|
||||||
echo "Uninstalling $Product $VERSION"
|
echo "Uninstalling $Product $VERSION"
|
||||||
|
|
||||||
[ -n "$SANDBOX" ] && configure=0
|
[ -n "$SANDBOX" ] && configure=0
|
||||||
|
|
||||||
INITSCRIPT=${CONFDIR}/init.d/$PRODUCT
|
[ -n "${LIBEXEC:=${SHAREDIR}}" ]
|
||||||
|
|
||||||
if [ -f "$INITSCRIPT" ]; then
|
rm -f ${SBINDIR}/$PRODUCT
|
||||||
|
|
||||||
|
FIREWALL=${CONFDIR}/init.d/$PRODUCT
|
||||||
|
|
||||||
|
if [ -f "$FIREWALL" ]; then
|
||||||
if [ $configure -eq 1 ]; then
|
if [ $configure -eq 1 ]; then
|
||||||
if [ $HOST = openwrt ]; then
|
if [ $HOST = openwrt ]; then
|
||||||
if /etc/init.d/$PRODUCT enabled; then
|
if /etc/init.d/$PRODUCT enabled; then
|
||||||
/etc/init.d/$PRODUCT disable
|
/etc/init.d/$PRODUCT disable
|
||||||
fi
|
fi
|
||||||
elif mywhich updaterc.d ; then
|
elif mywhich updaterc.d ; then
|
||||||
updaterc.d $PRODUCT remove
|
updaterc.d ${PRODUCT} remove
|
||||||
elif mywhich insserv ; then
|
elif mywhich insserv ; then
|
||||||
insserv -r $INITSCRIPT
|
insserv -r $FIREWALL
|
||||||
elif mywhich chkconfig ; then
|
elif mywhich chkconfig ; then
|
||||||
chkconfig --del $(basename $INITSCRIPT)
|
chkconfig --del $(basename $FIREWALL)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
remove_file $INITSCRIPT
|
remove_file $FIREWALL
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${SERVICEDIR}" ]; then
|
[ -z "${SERVICEDIR}" ] && SERVICEDIR="$SYSTEMD"
|
||||||
SERVICEDIR="$SYSTEMD"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$SERVICEDIR" ]; then
|
if [ -n "$SERVICEDIR" ]; then
|
||||||
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}.service
|
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}.service
|
||||||
@ -193,10 +200,11 @@ if [ -d ${CONFDIR}/ppp ]; then
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f ${SBINDIR}/$PRODUCT
|
|
||||||
rm -rf ${SHAREDIR}/$PRODUCT
|
rm -rf ${SHAREDIR}/$PRODUCT
|
||||||
rm -rf ${LIBEXECDIR}/$PRODUCT
|
rm -rf ${LIBEXECDIR}/$PRODUCT
|
||||||
|
rm -f ${CONFDIR}/logrotate.d/$PRODUCT
|
||||||
|
|
||||||
echo "$Product Uninstalled"
|
#
|
||||||
|
# Report Success
|
||||||
|
#
|
||||||
|
echo "$Product $VERSION Uninstalled"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
#
|
#
|
||||||
# Script to back uninstall Shoreline Firewall
|
# Script to back uninstall Shoreline Firewall Lite
|
||||||
#
|
#
|
||||||
# (c) 2000-2016 - Tom Eastep (teastep@shorewall.net)
|
# (c) 2000-2016 - Tom Eastep (teastep@shorewall.net)
|
||||||
#
|
#
|
||||||
@ -26,7 +26,7 @@
|
|||||||
# You may only use this script to uninstall the version
|
# You may only use this script to uninstall the version
|
||||||
# shown below. Simply run this script to remove Shorewall Firewall
|
# shown below. Simply run this script to remove Shorewall Firewall
|
||||||
|
|
||||||
VERSION=xxx #The Build script inserts the actual version
|
VERSION=xxx # The Build script inserts the actual version
|
||||||
PRODUCT=shorewall-lite
|
PRODUCT=shorewall-lite
|
||||||
Product="Shorewall Lite"
|
Product="Shorewall Lite"
|
||||||
|
|
||||||
@ -51,6 +51,9 @@ cd "$(dirname $0)"
|
|||||||
#
|
#
|
||||||
. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2; exit 1; }
|
. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2; exit 1; }
|
||||||
|
|
||||||
|
#
|
||||||
|
# Parse the run line
|
||||||
|
#
|
||||||
finished=0
|
finished=0
|
||||||
configure=1
|
configure=1
|
||||||
|
|
||||||
@ -67,7 +70,7 @@ while [ $finished -eq 0 ]; do
|
|||||||
usage 0
|
usage 0
|
||||||
;;
|
;;
|
||||||
v)
|
v)
|
||||||
echo "$Product Firewall Installer Version $VERSION"
|
echo "$Product Firewall Uninstaller Version $VERSION"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
n*)
|
n*)
|
||||||
@ -134,10 +137,12 @@ echo "Uninstalling $Product $VERSION"
|
|||||||
|
|
||||||
if [ $configure -eq 1 ]; then
|
if [ $configure -eq 1 ]; then
|
||||||
if qt iptables -L shorewall -n && [ ! -f ${SBINDIR}/shorewall ]; then
|
if qt iptables -L shorewall -n && [ ! -f ${SBINDIR}/shorewall ]; then
|
||||||
$PRODUCT clear
|
${SBINDIR}/$PRODUCT clear
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -f ${SBINDIR}/$PRODUCT
|
||||||
|
|
||||||
if [ -L ${SHAREDIR}/$PRODUCT/init ]; then
|
if [ -L ${SHAREDIR}/$PRODUCT/init ]; then
|
||||||
if [ $HOST = openwrt ]; then
|
if [ $HOST = openwrt ]; then
|
||||||
if [ $configure -eq 1 ] && /etc/init.d/$PRODUCT enabled; then
|
if [ $configure -eq 1 ] && /etc/init.d/$PRODUCT enabled; then
|
||||||
@ -155,7 +160,7 @@ fi
|
|||||||
if [ -f "$FIREWALL" ]; then
|
if [ -f "$FIREWALL" ]; then
|
||||||
if [ $configure -eq 1 ]; then
|
if [ $configure -eq 1 ]; then
|
||||||
if mywhich updaterc.d ; then
|
if mywhich updaterc.d ; then
|
||||||
updaterc.d $PRODUCT remove
|
updaterc.d ${PRODUCT} remove
|
||||||
elif mywhich insserv ; then
|
elif mywhich insserv ; then
|
||||||
insserv -r $FIREWALL
|
insserv -r $FIREWALL
|
||||||
elif mywhich chkconfig ; then
|
elif mywhich chkconfig ; then
|
||||||
@ -166,26 +171,29 @@ if [ -f "$FIREWALL" ]; then
|
|||||||
remove_file $FIREWALL
|
remove_file $FIREWALL
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -z "$SERVICEDIR" ] && SERVICEDIR="$SYSTEMD"
|
[ -z "${SERVICEDIR}" ] && SERVICEDIR="$SYSTEMD"
|
||||||
|
|
||||||
if [ -n "$SERVICEDIR" ]; then
|
if [ -n "$SERVICEDIR" ]; then
|
||||||
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}
|
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}.service
|
||||||
rm -f $SERVICEDIR/${PRODUCT}.service
|
rm -f $SERVICEDIR/${PRODUCT}.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f ${SBINDIR}/$PRODUCT
|
|
||||||
|
|
||||||
rm -rf ${CONFDIR}/$PRODUCT
|
rm -rf ${CONFDIR}/$PRODUCT
|
||||||
rm -rf ${VARDIR}
|
rm -rf ${VARDIR}
|
||||||
rm -rf ${SHAREDIR}/$PRODUCT
|
rm -rf ${SHAREDIR}/$PRODUCT
|
||||||
rm -rf ${LIBEXECDIR}/$PRODUCT
|
rm -rf ${LIBEXECDIR}/$PRODUCT
|
||||||
rm -f ${CONFDIR}/logrotate.d/$PRODUCT
|
rm -f ${CONFDIR}/logrotate.d/$PRODUCT
|
||||||
rm -f ${SYSCONFDIR}/$PRODUCT
|
|
||||||
|
if [ -n "$SYSCONFDIR" ]; then
|
||||||
|
[ -n "$SYSCONFFILE" ] && rm -f ${SYSCONFDIR}/${PRODUCT}
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${MANDIR}" ]; then
|
if [ -n "${MANDIR}" ]; then
|
||||||
rm -f ${MANDIR}/man5/${PRODUCT}*
|
rm -f ${MANDIR}/man5/${PRODUCT}*
|
||||||
rm -f ${MANDIR}/man8/${PRODUCT}*
|
rm -f ${MANDIR}/man8/${PRODUCT}*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$Product Uninstalled"
|
#
|
||||||
|
# Report Success
|
||||||
|
#
|
||||||
|
echo "$Product $VERSION Uninstalled"
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
# You may only use this script to uninstall the version
|
# You may only use this script to uninstall the version
|
||||||
# shown below. Simply run this script to remove Shorewall Firewall
|
# shown below. Simply run this script to remove Shorewall Firewall
|
||||||
|
|
||||||
VERSION=xxx #The Build script inserts the actual version
|
VERSION=xxx # The Build script inserts the actual version
|
||||||
PRODUCT=shorewall
|
PRODUCT=shorewall
|
||||||
Product=Shorewall
|
Product=Shorewall
|
||||||
|
|
||||||
@ -51,6 +51,9 @@ cd "$(dirname $0)"
|
|||||||
#
|
#
|
||||||
. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2; exit 1; }
|
. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2; exit 1; }
|
||||||
|
|
||||||
|
#
|
||||||
|
# Parse the run line
|
||||||
|
#
|
||||||
finished=0
|
finished=0
|
||||||
configure=1
|
configure=1
|
||||||
|
|
||||||
@ -67,7 +70,7 @@ while [ $finished -eq 0 ]; do
|
|||||||
usage 0
|
usage 0
|
||||||
;;
|
;;
|
||||||
v)
|
v)
|
||||||
echo "$Product Firewall Installer Version $VERSION"
|
echo "$Product Firewall Uninstaller Version $VERSION"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
n*)
|
n*)
|
||||||
@ -128,14 +131,13 @@ else
|
|||||||
VERSION=""
|
VERSION=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo "Uninstalling $Product $VERSION"
|
echo "Uninstalling $Product $VERSION"
|
||||||
|
|
||||||
[ -n "$SANDBOX" ] && configure=0
|
[ -n "$SANDBOX" ] && configure=0
|
||||||
|
|
||||||
if [ $configure -eq 1 ]; then
|
if [ $configure -eq 1 ]; then
|
||||||
if qt iptables -L shorewall -n && [ ! -f ${SBINDIR}/shorewall-lite ]; then
|
if qt iptables -L shorewall -n && [ ! -f ${SBINDIR}/shorewall-lite ]; then
|
||||||
$PRODUCT clear
|
${SBINDIR}/$PRODUCT clear
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -161,11 +163,10 @@ if [ -f "$FIREWALL" ]; then
|
|||||||
remove_file $FIREWALL
|
remove_file $FIREWALL
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${SERVICEDIR}" ]; then
|
[ -z "${SERVICEDIR}" ] && SERVICEDIR="$SYSTEMD"
|
||||||
SERVICEDIR="$SYSTEMD"
|
|
||||||
fi
|
|
||||||
if [ -n "$SERVICEDIR" ]; then
|
if [ -n "$SERVICEDIR" ]; then
|
||||||
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}
|
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}.service
|
||||||
rm -f $SERVICEDIR/${PRODUCT}.service
|
rm -f $SERVICEDIR/${PRODUCT}.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -176,12 +177,12 @@ if [ -n "$SYSCONFDIR" ]; then
|
|||||||
[ -n "$SYSCONFFILE" ] && rm -f ${SYSCONFDIR}/${PRODUCT}
|
[ -n "$SYSCONFFILE" ] && rm -f ${SYSCONFDIR}/${PRODUCT}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -rf ${VARDIR}/$PRODUCT
|
rm -rf ${VARDIR}
|
||||||
rm -rf ${PERLLIBDIR}/$Product/*
|
rm -rf ${PERLLIBDIR}/$Product/*
|
||||||
[ ${LIBEXECDIR} = ${SHAREDIR} ] || rm -rf ${LIBEXECDIR}/$PRODUCT
|
[ ${LIBEXECDIR} = ${SHAREDIR} ] || rm -rf ${LIBEXECDIR}/$PRODUCT
|
||||||
rm -rf ${SHAREDIR}/$PRODUCT/configfiles/
|
rm -rf ${SHAREDIR}/$PRODUCT/configfiles
|
||||||
rm -rf ${SHAREDIR}/$PRODUCT/Samples/
|
rm -rf ${SHAREDIR}/$PRODUCT/Samples
|
||||||
rm -rf ${SHAREDIR}/$PRODUCT/$Product/
|
rm -rf ${SHAREDIR}/$PRODUCT/$Product
|
||||||
rm -f ${SHAREDIR}/$PRODUCT/lib.cli-std
|
rm -f ${SHAREDIR}/$PRODUCT/lib.cli-std
|
||||||
rm -f ${SHAREDIR}/$PRODUCT/lib.runtime
|
rm -f ${SHAREDIR}/$PRODUCT/lib.runtime
|
||||||
rm -f ${SHAREDIR}/$PRODUCT/compiler.pl
|
rm -f ${SHAREDIR}/$PRODUCT/compiler.pl
|
||||||
@ -204,8 +205,9 @@ done
|
|||||||
|
|
||||||
rm -f ${CONFDIR}/logrotate.d/$PRODUCT
|
rm -f ${CONFDIR}/logrotate.d/$PRODUCT
|
||||||
|
|
||||||
[ -n "$SYSTEMD" ] && rm -f ${SYSTEMD}/${PRODUCT}.service
|
[ -n "$SYSTEMD" ] && rm -f ${SYSTEMD}/${PRODUCT}.service
|
||||||
|
|
||||||
echo "$Product Uninstalled"
|
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Report Success
|
||||||
|
#
|
||||||
|
echo "$Product $VERSION Uninstalled"
|
||||||
|
@ -26,14 +26,18 @@
|
|||||||
# You may only use this script to uninstall the version
|
# You may only use this script to uninstall the version
|
||||||
# shown below. Simply run this script to remove Shorewall Firewall
|
# shown below. Simply run this script to remove Shorewall Firewall
|
||||||
|
|
||||||
VERSION=xxx #The Build script inserts the actual version
|
VERSION=xxx # The Build script inserts the actual version
|
||||||
PRODUCT=shorewall6-lite
|
PRODUCT=shorewall6-lite
|
||||||
Product="Shorewall6 Lite"
|
Product="Shorewall6 Lite"
|
||||||
|
|
||||||
usage() # $1 = exit status
|
usage() # $1 = exit status
|
||||||
{
|
{
|
||||||
ME=$(basename $0)
|
ME=$(basename $0)
|
||||||
echo "usage: $ME [ <shorewallrc file> ]"
|
echo "usage: $ME [ <option> ] [ <shorewallrc file> ]"
|
||||||
|
echo "where <option> is one of"
|
||||||
|
echo " -h"
|
||||||
|
echo " -v"
|
||||||
|
echo " -n"
|
||||||
exit $1
|
exit $1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,6 +51,9 @@ cd "$(dirname $0)"
|
|||||||
#
|
#
|
||||||
. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2; exit 1; }
|
. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2; exit 1; }
|
||||||
|
|
||||||
|
#
|
||||||
|
# Parse the run line
|
||||||
|
#
|
||||||
finished=0
|
finished=0
|
||||||
configure=1
|
configure=1
|
||||||
|
|
||||||
@ -63,7 +70,7 @@ while [ $finished -eq 0 ]; do
|
|||||||
usage 0
|
usage 0
|
||||||
;;
|
;;
|
||||||
v)
|
v)
|
||||||
echo "$Product Firewall Installer Version $VERSION"
|
echo "$Product Firewall Uninstaller Version $VERSION"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
n*)
|
n*)
|
||||||
@ -134,7 +141,9 @@ if [ $configure -eq 1 ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f ${SHAREDIR}/$PRODUCT/init ]; then
|
rm -f ${SBINDIR}/$PRODUCT
|
||||||
|
|
||||||
|
if [ -L ${SHAREDIR}/$PRODUCT/init ]; then
|
||||||
if [ $HOST = openwrt ]; then
|
if [ $HOST = openwrt ]; then
|
||||||
if [ $configure -eq 1 ] && /etc/init.d/$PRODUCT enabled; then
|
if [ $configure -eq 1 ] && /etc/init.d/$PRODUCT enabled; then
|
||||||
/etc/init.d/$PRODUCT disable
|
/etc/init.d/$PRODUCT disable
|
||||||
@ -151,37 +160,40 @@ fi
|
|||||||
if [ -f "$FIREWALL" ]; then
|
if [ -f "$FIREWALL" ]; then
|
||||||
if [ $configure -eq 1 ]; then
|
if [ $configure -eq 1 ]; then
|
||||||
if mywhich updaterc.d ; then
|
if mywhich updaterc.d ; then
|
||||||
updaterc.d $PRODUCT remove
|
updaterc.d ${PRODUCT} remove
|
||||||
elif mywhich insserv ; then
|
elif mywhich insserv ; 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 $PRODUCT
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
remove_file $FIREWALL
|
remove_file $FIREWALL
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -z "$SERVICEDIR" ] && SERVICEDIR="$SYSTEMD"
|
[ -z "${SERVICEDIR}" ] && SERVICEDIR="$SYSTEMD"
|
||||||
|
|
||||||
if [ -n "$SERVICEDIR" ]; then
|
if [ -n "$SERVICEDIR" ]; then
|
||||||
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}
|
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}.service
|
||||||
rm -f $SERVICEDIR/${PRODUCT}.service
|
rm -f $SERVICEDIR/${PRODUCT}.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f ${SBINDIR}/$PRODUCT
|
|
||||||
rm -rf ${CONFDIR}/$PRODUCT
|
rm -rf ${CONFDIR}/$PRODUCT
|
||||||
rm -rf ${VARDIR}
|
rm -rf ${VARDIR}
|
||||||
rm -rf ${SHAREDIR}/$PRODUCT
|
rm -rf ${SHAREDIR}/$PRODUCT
|
||||||
rm -rf ${LIBEXECDIR}/$PRODUCT
|
rm -rf ${LIBEXECDIR}/$PRODUCT
|
||||||
rm -f ${CONFDIR}/logrotate.d/$PRODUCT
|
rm -f ${CONFDIR}/logrotate.d/$PRODUCT
|
||||||
rm -f ${SYSCONFDIR}/$PRODUCT
|
|
||||||
|
if [ -n "$SYSCONFDIR" ]; then
|
||||||
|
[ -n "$SYSCONFFILE" ] && rm -f ${SYSCONFDIR}/${PRODUCT}
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -n "${MANDIR}" ]; then
|
if [ -n "${MANDIR}" ]; then
|
||||||
rm -f ${MANDIR}/man5/${PRODUCT}*
|
rm -f ${MANDIR}/man5/${PRODUCT}*
|
||||||
rm -f ${MANDIR}/man8/${PRODUCT}*
|
rm -f ${MANDIR}/man8/${PRODUCT}*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$Product Uninstalled"
|
#
|
||||||
|
# Report Success
|
||||||
|
#
|
||||||
|
echo "$Product $VERSION Uninstalled"
|
||||||
|
@ -26,14 +26,18 @@
|
|||||||
# You may only use this script to uninstall the version
|
# You may only use this script to uninstall the version
|
||||||
# shown below. Simply run this script to remove Shorewall Firewall
|
# shown below. Simply run this script to remove Shorewall Firewall
|
||||||
|
|
||||||
VERSION=xxx #The Build script inserts the actual version
|
VERSION=xxx # The Build script inserts the actual version
|
||||||
PRODUCT=shorewall6
|
PRODUCT=shorewall6
|
||||||
Product=Shorewall6
|
Product=Shorewall6
|
||||||
|
|
||||||
usage() # $1 = exit status
|
usage() # $1 = exit status
|
||||||
{
|
{
|
||||||
ME=$(basename $0)
|
ME=$(basename $0)
|
||||||
echo "usage: $ME [ <shorewallrc file> ]"
|
echo "usage: $ME [ <option> ] [ <shorewallrc file> ]"
|
||||||
|
echo "where <option> is one of"
|
||||||
|
echo " -h"
|
||||||
|
echo " -v"
|
||||||
|
echo " -n"
|
||||||
exit $1
|
exit $1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,6 +51,9 @@ cd "$(dirname $0)"
|
|||||||
#
|
#
|
||||||
. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2; exit 1; }
|
. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2; exit 1; }
|
||||||
|
|
||||||
|
#
|
||||||
|
# Parse the run line
|
||||||
|
#
|
||||||
finished=0
|
finished=0
|
||||||
configure=1
|
configure=1
|
||||||
|
|
||||||
@ -63,7 +70,7 @@ while [ $finished -eq 0 ]; do
|
|||||||
usage 0
|
usage 0
|
||||||
;;
|
;;
|
||||||
v)
|
v)
|
||||||
echo "$Product Firewall Installer Version $VERSION"
|
echo "$Product Firewall Uninstaller Version $VERSION"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
n*)
|
n*)
|
||||||
@ -134,6 +141,8 @@ if [ $configure -eq 1 ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
rm -f ${SBINDIR}/$PRODUCT
|
||||||
|
|
||||||
if [ -L ${SHAREDIR}/$PRODUCT/init ]; then
|
if [ -L ${SHAREDIR}/$PRODUCT/init ]; then
|
||||||
FIREWALL=$(readlink -m -q ${SHAREDIR}/$PRODUCT/init)
|
FIREWALL=$(readlink -m -q ${SHAREDIR}/$PRODUCT/init)
|
||||||
elif [ -n "$INITFILE" ]; then
|
elif [ -n "$INITFILE" ]; then
|
||||||
@ -143,7 +152,7 @@ fi
|
|||||||
if [ -f "$FIREWALL" ]; then
|
if [ -f "$FIREWALL" ]; then
|
||||||
if [ $configure -eq 1 ]; then
|
if [ $configure -eq 1 ]; then
|
||||||
if mywhich updaterc.d ; then
|
if mywhich updaterc.d ; then
|
||||||
updaterc.d $PRODUCT remove
|
updaterc.d ${PRODUCT} remove
|
||||||
elif mywhich insserv ; then
|
elif mywhich insserv ; then
|
||||||
insserv -r $FIREWALL
|
insserv -r $FIREWALL
|
||||||
elif mywhich chkconfig ; then
|
elif mywhich chkconfig ; then
|
||||||
@ -154,10 +163,10 @@ if [ -f "$FIREWALL" ]; then
|
|||||||
remove_file $FIREWALL
|
remove_file $FIREWALL
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -n "$SERVICEDIR" ] || SERVICEDIR=${SYSTEMD}
|
[ -z "${SERVICEDIR}" ] && SERVICEDIR="$SYSTEMD"
|
||||||
|
|
||||||
if [ -n "$SERVICEDIR" ]; then
|
if [ -n "$SERVICEDIR" ]; then
|
||||||
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}
|
[ $configure -eq 1 ] && systemctl disable ${PRODUCT}.service
|
||||||
rm -f $SERVICEDIR/${PRODUCT}.service
|
rm -f $SERVICEDIR/${PRODUCT}.service
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -168,24 +177,26 @@ if [ -n "$SYSCONFDIR" ]; then
|
|||||||
[ -n "$SYSCONFFILE" ] && rm -f ${SYSCONFDIR}/${PRODUCT}
|
[ -n "$SYSCONFFILE" ] && rm -f ${SYSCONFDIR}/${PRODUCT}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f ${SBINDIR}/$PRODUCT
|
|
||||||
rm -rf ${CONFDIR}/$PRODUCT
|
rm -rf ${CONFDIR}/$PRODUCT
|
||||||
rm -rf ${VARDIR}
|
rm -rf ${VARDIR}
|
||||||
rm -rf ${LIBEXECDIR}/$PRODUCT
|
rm -rf ${LIBEXECDIR}/$PRODUCT
|
||||||
rm -rf ${SHAREDIR}/$PRODUCT
|
rm -rf ${SHAREDIR}/$PRODUCT
|
||||||
|
|
||||||
for f in ${MANDIR}/man5/${PRODUCT}* ${SHAREDIR}/man/man8/${PRODUCT}*; do
|
for f in ${MANDIR}/man5/${PRODUCT}* ${MANDIR}/man8/${PRODUCT}*; do
|
||||||
case $f in
|
case $f in
|
||||||
shorewall6-lite*)
|
shorewall6-lite*)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
rm -f $f
|
rm -f $f
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
rm -f ${CONFDIR}/logrotate.d/$PRODUCT
|
rm -f ${CONFDIR}/logrotate.d/$PRODUCT
|
||||||
|
|
||||||
[ -n "$SYSTEMD" ] && rm -f ${SYSTEMD}/${PRODUCT}.service
|
[ -n "$SYSTEMD" ] && rm -f ${SYSTEMD}/${PRODUCT}.service
|
||||||
|
|
||||||
echo "$Product Uninstalled"
|
#
|
||||||
|
# Report Success
|
||||||
|
#
|
||||||
|
echo "$Product $VERSION Uninstalled"
|
||||||
|
Loading…
Reference in New Issue
Block a user