diff --git a/Shorewall-core/install.sh b/Shorewall-core/install.sh index 23cbf8bee..6e4a13101 100755 --- a/Shorewall-core/install.sh +++ b/Shorewall-core/install.sh @@ -126,7 +126,7 @@ while [ $finished -eq 0 ]; do usage 0 ;; v) - echo "Shorewall Firewall Installer Version $VERSION" + echo "$Product Firewall Installer Version $VERSION" exit 0 ;; *) @@ -315,7 +315,7 @@ if [ -n "$DESTDIR" ]; then fi fi -echo "Installing Shorewall Core Version $VERSION" +echo "Installing $Product Version $VERSION" # # Create directories @@ -454,4 +454,4 @@ fi # # Report Success # -echo "Shorewall Core Version $VERSION Installed" +echo "$Product Version $VERSION Installed" diff --git a/Shorewall-core/uninstall.sh b/Shorewall-core/uninstall.sh index e04b55f0a..d55093d32 100755 --- a/Shorewall-core/uninstall.sh +++ b/Shorewall-core/uninstall.sh @@ -104,20 +104,20 @@ fi if [ -f ${SHAREDIR}/shorewall/coreversion ]; then INSTALLED_VERSION="$(cat ${SHAREDIR}/shorewall/coreversion)" if [ "$INSTALLED_VERSION" != "$VERSION" ]; then - echo "WARNING: Shorewall Core Version $INSTALLED_VERSION is installed" + echo "WARNING: $Product Version $INSTALLED_VERSION is installed" echo " and this is the $VERSION uninstaller." VERSION="$INSTALLED_VERSION" fi else - echo "WARNING: Shorewall Core Version $VERSION is not installed" + echo "WARNING: $Product Version $VERSION is not installed" VERSION="" fi -echo "Uninstalling Shorewall Core $VERSION" +echo "Uninstalling $Product $VERSION" rm -rf ${SHAREDIR}/shorewall rm -f ~/.shorewallrc -echo "Shorewall Core Uninstalled" +echo "$Product Uninstalled" diff --git a/Shorewall-init/install.sh b/Shorewall-init/install.sh index 4749c0258..937131ef8 100755 --- a/Shorewall-init/install.sh +++ b/Shorewall-init/install.sh @@ -134,7 +134,7 @@ while [ $finished -eq 0 ] ; do usage 0 ;; v) - echo "Shorewall-init Firewall Installer Version $VERSION" + echo "$Product Firewall Installer Version $VERSION" exit 0 ;; n*) @@ -318,12 +318,12 @@ if [ -n "$DESTDIR" ]; then make_directory ${DESTDIR}${INITDIR} 0755 fi -echo "Installing Shorewall Init Version $VERSION" +echo "Installing $Product Version $VERSION" # # Check for /usr/share/shorewall-init/version # -if [ -f ${DESTDIR}${SHAREDIR}/shorewall-init/version ]; then +if [ -f ${DESTDIR}${SHAREDIR}/$PRODUCT/version ]; then first_install="" else first_install="Yes" @@ -366,16 +366,16 @@ if [ -n "$SERVICEDIR" ]; then mkdir -p ${DESTDIR}${SBINDIR} chmod 0755 ${DESTDIR}${SBINDIR} fi - install_file shorewall-init ${DESTDIR}${SBINDIR}/shorewall-init 0700 - [ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SBINDIR}/shorewall-init - echo "CLI installed as ${DESTDIR}${SBINDIR}/shorewall-init" + install_file $PRODUCT ${DESTDIR}${SBINDIR}/$PRODUCT 0700 + [ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ${DESTDIR}${SBINDIR}/$PRODUCT + echo "CLI installed as ${DESTDIR}${SBINDIR}/$PRODUCT" fi # # Create /usr/share/shorewall-init if needed # -mkdir -p ${DESTDIR}${SHAREDIR}/shorewall-init -chmod 0755 ${DESTDIR}${SHAREDIR}/shorewall-init +mkdir -p ${DESTDIR}${SHAREDIR}/$PRODUCT +chmod 0755 ${DESTDIR}${SHAREDIR}/$PRODUCT # # Install logrotate file @@ -388,15 +388,15 @@ fi # # Create the version file # -echo "$VERSION" > ${DESTDIR}/${SHAREDIR}/shorewall-init/version -chmod 0644 ${DESTDIR}${SHAREDIR}/shorewall-init/version +echo "$VERSION" > ${DESTDIR}/${SHAREDIR}/$PRODUCT/version +chmod 0644 ${DESTDIR}${SHAREDIR}/$PRODUCT/version # # Remove and create the symbolic link to the init script # if [ -z "$DESTDIR" ]; then - rm -f ${SHAREDIR}/shorewall-init/init - ln -s ${INITDIR}/${INITFILE} ${SHAREDIR}/shorewall-init/init + rm -f ${SHAREDIR}/$PRODUCT/init + ln -s ${INITDIR}/${INITFILE} ${SHAREDIR}/$PRODUCT/init fi if [ $HOST = debian ]; then @@ -410,13 +410,13 @@ if [ $HOST = debian ]; then mkdir -p ${DESTDIR}${CONFDIR}/network/if-post-down.d/ fi - if [ ! -f ${DESTDIR}${CONFDIR}/default/shorewall-init ]; then + if [ ! -f ${DESTDIR}${CONFDIR}/default/$PRODUCT ]; then if [ -n "${DESTDIR}" ]; then mkdir -p ${DESTDIR}${ETC}/default fi [ $configure -eq 1 ] || mkdir -p ${DESTDIR}${CONFDIR}/default - install_file sysconfig ${DESTDIR}${ETC}/default/shorewall-init 0644 + install_file sysconfig ${DESTDIR}${ETC}/default/$PRODUCT 0644 echo "sysconfig file installed in ${DESTDIR}${SYSCONFDIR}/${PRODUCT}" fi @@ -458,9 +458,9 @@ if [ $HOST != openwrt ]; then [ "${SHAREDIR}" = /usr/share ] || eval sed -i \'s\|/usr/share/\|${SHAREDIR}/\|\' ifupdown - mkdir -p ${DESTDIR}${LIBEXECDIR}/shorewall-init + mkdir -p ${DESTDIR}${LIBEXECDIR}/$PRODUCT - install_file ifupdown ${DESTDIR}${LIBEXECDIR}/shorewall-init/ifupdown 0544 + install_file ifupdown ${DESTDIR}${LIBEXECDIR}/$PRODUCT/ifupdown 0544 fi if [ -d ${DESTDIR}/etc/NetworkManager ]; then @@ -518,17 +518,17 @@ if [ -z "$DESTDIR" ]; then if [ $HOST = debian ]; then if [ -n "$SERVICEDIR" ]; then if systemctl enable ${PRODUCT}.service; then - echo "Shorewall Init will start automatically at boot" + echo "$Product will start automatically at boot" fi elif mywhich insserv; then - if insserv ${INITDIR}/shorewall-init; then - echo "Shorewall Init will start automatically at boot" + if insserv ${INITDIR}/$PRODUCT; then + echo "$Product will start automatically at boot" else cant_autostart fi elif mywhich update-rc.d ; then if update-rc.d $PRODUCT enable; then - echo "$PRODUCT will start automatically at boot" + echo "$Product will start automatically at boot" echo "Set startup=1 in ${CONFDIR}/default/$PRODUCT to enable" else cant_autostart @@ -549,31 +549,31 @@ if [ -z "$DESTDIR" ]; then /bin/true else if [ -n "$SERVICEDIR" ]; then - if systemctl enable shorewall-init.service; then - echo "Shorewall Init will start automatically at boot" + if systemctl enable ${PRODUCT}.service; then + echo "$Product will start automatically at boot" fi elif [ -x ${SBINDIR}/insserv -o -x /usr${SBINDIR}/insserv ]; then - if insserv ${INITDIR}/shorewall-init ; then - echo "Shorewall Init will start automatically at boot" + if insserv ${INITDIR}/$PRODUCT ; then + echo "$Product will start automatically at boot" else cant_autostart fi elif [ -x ${SBINDIR}/chkconfig -o -x /usr${SBINDIR}/chkconfig ]; then - if chkconfig --add shorewall-init ; then - echo "Shorewall Init will start automatically in run levels as follows:" - chkconfig --list shorewall-init + if chkconfig --add $PRODUCT ; then + echo "$Product will start automatically at boot" + chkconfig --list $PRODUCT else cant_autostart fi elif [ -x ${SBINDIR}/rc-update ]; then - if rc-update add shorewall-init default; then - echo "Shorewall Init will start automatically at boot" + if rc-update add $PRODUCT default; then + echo "$Product will start automatically at boot" else cant_autostart fi elif [ $HOST = openwrt -a -f ${CONFDIR}/rc.common ]; then /etc/init.d/$PRODUCT enable - if /etc/init.d/shorewall-init enabled; then + if /etc/init.d/$PRODUCT enabled; then echo "$Product will start automatically at boot" else cant_autostart @@ -590,8 +590,8 @@ else mkdir -p ${DESTDIR}/etc/rcS.d fi - ln -sf ../init.d/shorewall-init ${DESTDIR}${CONFDIR}/rcS.d/S38shorewall-init - echo "Shorewall Init will start automatically at boot" + ln -sf ../init.d/$PRODUCT ${DESTDIR}${CONFDIR}/rcS.d/S38${PRODUCT} + echo "$Product will start automatically at boot" fi fi fi @@ -603,7 +603,7 @@ if [ -d ${DESTDIR}/etc/ppp ]; then debian|suse) for directory in ip-up.d ip-down.d ipv6-up.d ipv6-down.d; do mkdir -p ${DESTDIR}/etc/ppp/$directory #SuSE doesn't create the IPv6 directories - cp -fp ${DESTDIR}${LIBEXECDIR}/shorewall-init/ifupdown ${DESTDIR}${CONFDIR}/ppp/$directory/shorewall + cp -fp ${DESTDIR}${LIBEXECDIR}/$PRODUCT/ifupdown ${DESTDIR}${CONFDIR}/ppp/$directory/shorewall done ;; redhat) @@ -614,13 +614,13 @@ if [ -d ${DESTDIR}/etc/ppp ]; then FILE=${DESTDIR}/etc/ppp/$file if [ -f $FILE ]; then if grep -qF Shorewall-based $FILE ; then - cp -fp ${DESTDIR}${LIBEXECDIR}/shorewall-init/ifupdown $FILE + cp -fp ${DESTDIR}${LIBEXECDIR}/$PRODUCT/ifupdown $FILE else echo "$FILE already exists -- ppp devices will not be handled" break fi else - cp -fp ${DESTDIR}${LIBEXECDIR}/shorewall-init/ifupdown $FILE + cp -fp ${DESTDIR}${LIBEXECDIR}/$PRODUCT/ifupdown $FILE fi done ;; diff --git a/Shorewall-init/uninstall.sh b/Shorewall-init/uninstall.sh index f8c260860..b7cdfec1c 100755 --- a/Shorewall-init/uninstall.sh +++ b/Shorewall-init/uninstall.sh @@ -146,34 +146,34 @@ else usage 1 fi -if [ -f ${SHAREDIR}/shorewall-init/version ]; then - INSTALLED_VERSION="$(cat ${SHAREDIR}/shorewall-init/version)" +if [ -f ${SHAREDIR}/$PRODUCT/version ]; then + INSTALLED_VERSION="$(cat ${SHAREDIR}/$PRODUCT/version)" if [ "$INSTALLED_VERSION" != "$VERSION" ]; then - echo "WARNING: Shorewall Init Version $INSTALLED_VERSION is installed" + echo "WARNING: $Product Version $INSTALLED_VERSION is installed" echo " and this is the $VERSION uninstaller." VERSION="$INSTALLED_VERSION" fi else - echo "WARNING: Shorewall Init Version $VERSION is not installed" + echo "WARNING: $Product Version $VERSION is not installed" VERSION="" fi [ -n "${LIBEXEC:=${SHAREDIR}}" ] -echo "Uninstalling Shorewall Init $VERSION" +echo "Uninstalling $Product $VERSION" [ -n "$SANDBOX" ] && configure=0 -INITSCRIPT=${CONFDIR}/init.d/shorewall-init +INITSCRIPT=${CONFDIR}/init.d/$PRODUCT if [ -f "$INITSCRIPT" ]; then if [ $configure -eq 1 ]; then if [ $HOST = openwrt ]; then - if /etc/init.d/shorewall-init enabled; then - /etc/init.d/shorewall-init disable + if /etc/init.d/$PRODUCT enabled; then + /etc/init.d/$PRODUCT disable fi elif mywhich updaterc.d ; then - updaterc.d shorewall-init remove + updaterc.d $PRODUCT remove elif mywhich insserv ; then insserv -r $INITSCRIPT elif mywhich chkconfig ; then @@ -189,20 +189,20 @@ if [ -z "${SERVICEDIR}" ]; then fi if [ -n "$SERVICEDIR" ]; then - [ $configure -eq 1 ] && systemctl disable shorewall-init.service - rm -f $SERVICEDIR/shorewall-init.service + [ $configure -eq 1 ] && systemctl disable ${PRODUCT}.service + rm -f $SERVICEDIR/${PRODUCT}.service fi if [ $HOST = openwrt ]; then - [ "$(readlink -q ${SBINDIR}/ifup-local)" = ${SHAREDIR}/shorewall-init ] && remove_file ${SBINDIR}/ifup-local - [ "$(readlink -q ${SBINDIR}/ifdown-local)" = ${SHAREDIR}/shorewall-init ] && remove_file ${SBINDIR}/ifdown-local + [ "$(readlink -q ${SBINDIR}/ifup-local)" = ${SHAREDIR}/$PRODUCT ] && remove_file ${SBINDIR}/ifup-local + [ "$(readlink -q ${SBINDIR}/ifdown-local)" = ${SHAREDIR}/$PRODUCT ] && remove_file ${SBINDIR}/ifdown-local else - [ "$(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}/ifup-local)" = ${SHAREDIR}/$PRODUCT ] && remove_file ${SBINDIR}/ifup-local + [ "$(readlink -m -q ${SBINDIR}/ifdown-local)" = ${SHAREDIR}/$PRODUCT ] && remove_file ${SBINDIR}/ifdown-local fi -remove_file ${CONFDIR}/default/shorewall-init -remove_file ${CONFDIR}/sysconfig/shorewall-init +remove_file ${CONFDIR}/default/$PRODUCT +remove_file ${CONFDIR}/sysconfig/$PRODUCT remove_file ${CONFDIR}/NetworkManager/dispatcher.d/01-shorewall @@ -227,10 +227,10 @@ if [ -d ${CONFDIR}/ppp ]; then done fi -rm -f ${SBINDIR}/shorewall-init -rm -rf ${SHAREDIR}/shorewall-init -rm -rf ${LIBEXECDIR}/shorewall-init +rm -f ${SBINDIR}/$PRODUCT +rm -rf ${SHAREDIR}/$PRODUCT +rm -rf ${LIBEXECDIR}/$PRODUCT -echo "Shorewall Init Uninstalled" +echo "$Product Uninstalled" diff --git a/Shorewall-lite/uninstall.sh b/Shorewall-lite/uninstall.sh index 8a5cf4e6a..546679f6d 100755 --- a/Shorewall-lite/uninstall.sh +++ b/Shorewall-lite/uninstall.sh @@ -145,37 +145,37 @@ else usage 1 fi -if [ -f ${SHAREDIR}/shorewall-lite/version ]; then - INSTALLED_VERSION="$(cat ${SHAREDIR}/shorewall-lite/version)" +if [ -f ${SHAREDIR}/$PRODUCT/version ]; then + INSTALLED_VERSION="$(cat ${SHAREDIR}/$PRODUCT/version)" if [ "$INSTALLED_VERSION" != "$VERSION" ]; then - echo "WARNING: Shorewall Lite Version $INSTALLED_VERSION is installed" + echo "WARNING: $Product Version $INSTALLED_VERSION is installed" echo " and this is the $VERSION uninstaller." VERSION="$INSTALLED_VERSION" fi else - echo "WARNING: Shorewall Lite Version $VERSION is not installed" + echo "WARNING: $Product Version $VERSION is not installed" VERSION="" fi -echo "Uninstalling Shorewall Lite $VERSION" +echo "Uninstalling $Product $VERSION" [ -n "$SANDBOX" ] && configure=0 if [ $configure -eq 1 ]; then if qt iptables -L shorewall -n && [ ! -f ${SBINDIR}/shorewall ]; then - shorewall-lite clear + $PRODUCT clear fi fi -if [ -L ${SHAREDIR}/shorewall-lite/init ]; then +if [ -L ${SHAREDIR}/$PRODUCT/init ]; then if [ $HOST = openwrt ]; then - if [ $configure -eq 1 ] && /etc/init.d/shorewall-lite enabled; then - /etc/init.d/shorewall-lite disable + if [ $configure -eq 1 ] && /etc/init.d/$PRODUCT enabled; then + /etc/init.d/$PRODUCT disable fi - FIREWALL=$(readlink ${SHAREDIR}/shorewall-lite/init) + FIREWALL=$(readlink ${SHAREDIR}/$PRODUCT/init) else - FIREWALL=$(readlink -m -q ${SHAREDIR}/shorewall-lite/init) + FIREWALL=$(readlink -m -q ${SHAREDIR}/$PRODUCT/init) fi elif [ -n "$INITFILE" ]; then FIREWALL=${INITDIR}/${INITFILE} @@ -184,7 +184,7 @@ fi if [ -f "$FIREWALL" ]; then if [ $configure -eq 1 ]; then if mywhich updaterc.d ; then - updaterc.d shorewall-lite remove + updaterc.d $PRODUCT remove elif mywhich insserv ; then insserv -r $FIREWALL elif mywhich chkconfig ; then @@ -199,22 +199,22 @@ fi if [ -n "$SERVICEDIR" ]; then [ $configure -eq 1 ] && systemctl disable ${PRODUCT} - rm -f $SERVICEDIR/shorewall-lite.service + rm -f $SERVICEDIR/${PRODUCT}.service fi -rm -f ${SBINDIR}/shorewall-lite +rm -f ${SBINDIR}/$PRODUCT -rm -rf ${CONFDIR}/shorewall-lite +rm -rf ${CONFDIR}/$PRODUCT rm -rf ${VARDIR} -rm -rf ${SHAREDIR}/shorewall-lite -rm -rf ${LIBEXECDIR}/shorewall-lite -rm -f ${CONFDIR}/logrotate.d/shorewall-lite -rm -f ${SYSCONFDIR}/shorewall-lite +rm -rf ${SHAREDIR}/$PRODUCT +rm -rf ${LIBEXECDIR}/$PRODUCT +rm -f ${CONFDIR}/logrotate.d/$PRODUCT +rm -f ${SYSCONFDIR}/$PRODUCT if [ -n "${MANDIR}" ]; then - rm -f ${MANDIR}/man5/shorewall-lite* - rm -f ${MANDIR}/man8/shorewall-lite* + rm -f ${MANDIR}/man5/${PRODUCT}* + rm -f ${MANDIR}/man8/${PRODUCT}* fi -echo "Shorewall Lite Uninstalled" +echo "$Product Uninstalled" diff --git a/Shorewall/uninstall.sh b/Shorewall/uninstall.sh index 7fb9cb5fa..eb6975da5 100755 --- a/Shorewall/uninstall.sh +++ b/Shorewall/uninstall.sh @@ -148,33 +148,33 @@ else usage 1 fi -if [ -f ${SHAREDIR}/shorewall/version ]; then - INSTALLED_VERSION="$(cat ${SHAREDIR}/shorewall/version)" +if [ -f ${SHAREDIR}/$PRODUCT/version ]; then + INSTALLED_VERSION="$(cat ${SHAREDIR}/$PRODUCT/version)" if [ "$INSTALLED_VERSION" != "$VERSION" ]; then - echo "WARNING: Shorewall Version $INSTALLED_VERSION is installed" + echo "WARNING: $Product Version $INSTALLED_VERSION is installed" echo " and this is the $VERSION uninstaller." VERSION="$INSTALLED_VERSION" fi else - echo "WARNING: Shorewall Version $VERSION is not installed" + echo "WARNING: $Product Version $VERSION is not installed" VERSION="" fi -echo "Uninstalling shorewall $VERSION" +echo "Uninstalling $Product $VERSION" [ -n "$SANDBOX" ] && configure=0 if [ $configure -eq 1 ]; then if qt iptables -L shorewall -n && [ ! -f ${SBINDIR}/shorewall-lite ]; then - shorewall clear + $PRODUCT clear fi fi -rm -f ${SBINDIR}/shorewall +rm -f ${SBINDIR}/$PRODUCT -if [ -L ${SHAREDIR}/shorewall/init ]; then - FIREWALL=$(readlink -m -q ${SHAREDIR}/shorewall/init) +if [ -L ${SHAREDIR}/$PRODUCT/init ]; then + FIREWALL=$(readlink -m -q ${SHAREDIR}/$PRODUCT/init) elif [ -n "$INITFILE" ]; then FIREWALL=${INITDIR}/${INITFILE} fi @@ -198,33 +198,33 @@ if [ -z "${SERVICEDIR}" ]; then fi if [ -n "$SERVICEDIR" ]; then [ $configure -eq 1 ] && systemctl disable ${PRODUCT} - rm -f $SERVICEDIR/shorewall.service + rm -f $SERVICEDIR/${PRODUCT}.service fi -rm -rf ${SHAREDIR}/shorewall/version -rm -rf ${CONFDIR}/shorewall +rm -rf ${SHAREDIR}/$PRODUCT/version +rm -rf ${CONFDIR}/$PRODUCT if [ -n "$SYSCONFDIR" ]; then [ -n "$SYSCONFFILE" ] && rm -f ${SYSCONFDIR}/${PRODUCT} fi -rm -rf ${VARDIR}/shorewall -rm -rf ${PERLLIBDIR}/Shorewall/* -[ ${LIBEXECDIR} = ${SHAREDIR} ] || rm -rf ${LIBEXECDIR}/shorewall -rm -rf ${SHAREDIR}/shorewall/configfiles/ -rm -rf ${SHAREDIR}/shorewall/Samples/ -rm -rf ${SHAREDIR}/shorewall/Shorewall/ -rm -f ${SHAREDIR}/shorewall/lib.cli-std -rm -f ${SHAREDIR}/shorewall/lib.runtime -rm -f ${SHAREDIR}/shorewall/compiler.pl -rm -f ${SHAREDIR}/shorewall/prog.* -rm -f ${SHAREDIR}/shorewall/module* -rm -f ${SHAREDIR}/shorewall/helpers -rm -f ${SHAREDIR}/shorewall/action* -rm -f ${SHAREDIR}/shorewall/macro.* -rm -f ${SHAREDIR}/shorewall/init +rm -rf ${VARDIR}/$PRODUCT +rm -rf ${PERLLIBDIR}/$Product/* +[ ${LIBEXECDIR} = ${SHAREDIR} ] || rm -rf ${LIBEXECDIR}/$PRODUCT +rm -rf ${SHAREDIR}/$PRODUCT/configfiles/ +rm -rf ${SHAREDIR}/$PRODUCT/Samples/ +rm -rf ${SHAREDIR}/$PRODUCT/$Product/ +rm -f ${SHAREDIR}/$PRODUCT/lib.cli-std +rm -f ${SHAREDIR}/$PRODUCT/lib.runtime +rm -f ${SHAREDIR}/$PRODUCT/compiler.pl +rm -f ${SHAREDIR}/$PRODUCT/prog.* +rm -f ${SHAREDIR}/$PRODUCT/module* +rm -f ${SHAREDIR}/$PRODUCT/helpers +rm -f ${SHAREDIR}/$PRODUCT/action* +rm -f ${SHAREDIR}/$PRODUCT/macro.* +rm -f ${SHAREDIR}/$PRODUCT/init -for f in ${MANDIR}/man5/shorewall* ${MANDIR}/man8/shorewall*; do +for f in ${MANDIR}/man5/${PRODUCT}* ${MANDIR}/man8/${PRODUCT}*; do case $f in shorewall6*|shorewall-lite*) ;; @@ -234,10 +234,10 @@ for f in ${MANDIR}/man5/shorewall* ${MANDIR}/man8/shorewall*; do esac done -rm -f ${CONFDIR}/logrotate.d/shorewall +rm -f ${CONFDIR}/logrotate.d/$PRODUCT -[ -n "$SYSTEMD" ] && rm -f ${SYSTEMD}/shorewall.service +[ -n "$SYSTEMD" ] && rm -f ${SYSTEMD}/${PRODUCT}.service -echo "Shorewall Uninstalled" +echo "$Product Uninstalled" diff --git a/Shorewall6-lite/uninstall.sh b/Shorewall6-lite/uninstall.sh index 5519bed80..0c4495aea 100755 --- a/Shorewall6-lite/uninstall.sh +++ b/Shorewall6-lite/uninstall.sh @@ -146,37 +146,37 @@ else usage 1 fi -if [ -f ${SHAREDIR}/shorewall6-lite/version ]; then - INSTALLED_VERSION="$(cat ${SHAREDIR}/shorewall6-lite/version)" +if [ -f ${SHAREDIR}/$PRODUCT/version ]; then + INSTALLED_VERSION="$(cat ${SHAREDIR}/$PRODUCT/version)" if [ "$INSTALLED_VERSION" != "$VERSION" ]; then - echo "WARNING: Shorewall6 Lite Version $INSTALLED_VERSION is installed" + echo "WARNING: $Product Version $INSTALLED_VERSION is installed" echo " and this is the $VERSION uninstaller." VERSION="$INSTALLED_VERSION" fi else - echo "WARNING: Shorewall6 Lite Version $VERSION is not installed" + echo "WARNING: $Product Version $VERSION is not installed" VERSION="" fi -echo "Uninstalling Shorewall6 Lite $VERSION" +echo "Uninstalling $Product $VERSION" [ -n "$SANDBOX" ] && configure=0 if [ $configure -eq 1 ]; then if qt ip6tables -L shorewall -n && [ ! -f ${SBINDIR}/shorewall6 ]; then - ${SBINDIR}/shorewall6-lite clear + ${SBINDIR}/$PRODUCT clear fi fi -if [ -f ${SHAREDIR}/shorewall6-lite/init ]; then +if [ -f ${SHAREDIR}/$PRODUCT/init ]; then if [ $HOST = openwrt ]; then - if [ $configure -eq 1 ] && /etc/init.d/shorewall6-lite enabled; then - /etc/init.d/shorewall6-lite disable + if [ $configure -eq 1 ] && /etc/init.d/$PRODUCT enabled; then + /etc/init.d/$PRODUCT disable fi - FIREWALL=$(readlink ${SHAREDIR}/shorewall6-lite/init) + FIREWALL=$(readlink ${SHAREDIR}/$PRODUCT/init) else - FIREWALL=$(readlink -m -q ${SHAREDIR}/shorewall6-lite/init) + FIREWALL=$(readlink -m -q ${SHAREDIR}/$PRODUCT/init) fi elif [ -n "$INITFILE" ]; then FIREWALL=${INITDIR}/${INITFILE} @@ -185,13 +185,13 @@ fi if [ -f "$FIREWALL" ]; then if [ $configure -eq 1 ]; then if mywhich updaterc.d ; then - updaterc.d shorewall6-lite remove + updaterc.d $PRODUCT remove elif mywhich insserv ; then insserv -r $FIREWALL elif mywhich chkconfig ; then chkconfig --del $(basename $FIREWALL) elif mywhich systemctl ; then - systemctl disable shorewall6-lite + systemctl disable $PRODUCT fi fi @@ -202,20 +202,20 @@ fi if [ -n "$SERVICEDIR" ]; then [ $configure -eq 1 ] && systemctl disable ${PRODUCT} - rm -f $SERVICEDIR/shorewall6-lite.service + rm -f $SERVICEDIR/${PRODUCT}.service fi -rm -f ${SBINDIR}/shorewall6-lite -rm -rf ${CONFDIR}/shorewall6-lite +rm -f ${SBINDIR}/$PRODUCT +rm -rf ${CONFDIR}/$PRODUCT rm -rf ${VARDIR} -rm -rf ${SHAREDIR}/shorewall6-lite -rm -rf ${LIBEXECDIR}/shorewall6-lite -rm -f ${CONFDIR}/logrotate.d/shorewall6-lite -rm -f ${SYSCONFDIR}/shorewall6-lite +rm -rf ${SHAREDIR}/$PRODUCT +rm -rf ${LIBEXECDIR}/$PRODUCT +rm -f ${CONFDIR}/logrotate.d/$PRODUCT +rm -f ${SYSCONFDIR}/$PRODUCT if [ -n "${MANDIR}" ]; then - rm -f ${MANDIR}/man5/shorewall6-lite* - rm -f ${MANDIR}/man8/shorewall6-lite* + rm -f ${MANDIR}/man5/${PRODUCT}* + rm -f ${MANDIR}/man8/${PRODUCT}* fi -echo "Shorewall6 Lite Uninstalled" +echo "$Product Uninstalled" diff --git a/Shorewall6/uninstall.sh b/Shorewall6/uninstall.sh index 9652b942e..f89f09f88 100755 --- a/Shorewall6/uninstall.sh +++ b/Shorewall6/uninstall.sh @@ -147,30 +147,30 @@ else usage 1 fi -if [ -f ${SHAREDIR}/shorewall6/version ]; then - INSTALLED_VERSION="$(cat ${SHAREDIR}/shorewall6/version)" +if [ -f ${SHAREDIR}/$PRODUCT/version ]; then + INSTALLED_VERSION="$(cat ${SHAREDIR}/$PRODUCT/version)" if [ "$INSTALLED_VERSION" != "$VERSION" ]; then - echo "WARNING: Shorewall6 Version $INSTALLED_VERSION is installed" + echo "WARNING: $Product Version $INSTALLED_VERSION is installed" echo " and this is the $VERSION uninstaller." VERSION="$INSTALLED_VERSION" fi else - echo "WARNING: Shorewall6 Version $VERSION is not installed" + echo "WARNING: $Product Version $VERSION is not installed" VERSION="" fi -echo "Uninstalling shorewall6 $VERSION" +echo "Uninstalling $Product $VERSION" [ -n "$SANDBOX" ] && configure=0 if [ $configure -eq 1 ]; then if qt ip6tables -L shorewall6 -n && [ ! -f ${SBINDIR}/shorewall6-lite ]; then - ${SBINDIR}/shorewall6 clear + ${SBINDIR}/$PRODUCT clear fi fi -if [ -L ${SHAREDIR}/shorewall6/init ]; then - FIREWALL=$(readlink -m -q ${SHAREDIR}/shorewall6/init) +if [ -L ${SHAREDIR}/$PRODUCT/init ]; then + FIREWALL=$(readlink -m -q ${SHAREDIR}/$PRODUCT/init) elif [ -n "$INITFILE" ]; then FIREWALL=${INITDIR}/${INITFILE} fi @@ -178,7 +178,7 @@ fi if [ -f "$FIREWALL" ]; then if [ $configure -eq 1 ]; then if mywhich updaterc.d ; then - updaterc.d shorewall6 remove + updaterc.d $PRODUCT remove elif mywhich insserv ; then insserv -r $FIREWALL elif mywhich chkconfig ; then @@ -193,23 +193,23 @@ fi if [ -n "$SERVICEDIR" ]; then [ $configure -eq 1 ] && systemctl disable ${PRODUCT} - rm -f $SERVICEDIR/shorewall6.service + rm -f $SERVICEDIR/${PRODUCT}.service fi -rm -rf ${SHAREDIR}/shorewall6/version -rm -rf ${CONFDIR}/shorewall6 +rm -rf ${SHAREDIR}/$PRODUCT/version +rm -rf ${CONFDIR}/$PRODUCT if [ -n "$SYSCONFDIR" ]; then [ -n "$SYSCONFFILE" ] && rm -f ${SYSCONFDIR}/${PRODUCT} fi -rm -f ${SBINDIR}/shorewall6 -rm -rf ${CONFDIR}/shorewall6 +rm -f ${SBINDIR}/$PRODUCT +rm -rf ${CONFDIR}/$PRODUCT rm -rf ${VARDIR} -rm -rf ${LIBEXECDIR}/shorewall6 -rm -rf ${SHAREDIR}/shorewall6 +rm -rf ${LIBEXECDIR}/$PRODUCT +rm -rf ${SHAREDIR}/$PRODUCT -for f in ${MANDIR}/man5/shorewall6* ${SHAREDIR}/man/man8/shorewall6*; do +for f in ${MANDIR}/man5/${PRODUCT}* ${SHAREDIR}/man/man8/${PRODUCT}*; do case $f in shorewall6-lite*) ;; @@ -218,9 +218,9 @@ for f in ${MANDIR}/man5/shorewall6* ${SHAREDIR}/man/man8/shorewall6*; do esac done -rm -f ${CONFDIR}/logrotate.d/shorewall6 -[ -n "$SYSTEMD" ] && rm -f ${SYSTEMD}/shorewall6.service +rm -f ${CONFDIR}/logrotate.d/$PRODUCT +[ -n "$SYSTEMD" ] && rm -f ${SYSTEMD}/${PRODUCT}.service -echo "Shorewall6 Uninstalled" +echo "$Product Uninstalled"