Update uninstall scripts for multiple .shorewallrc locations.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-03-26 16:19:40 -07:00
parent e641bf7ac2
commit b31f656d63
6 changed files with 64 additions and 14 deletions

View File

@ -60,12 +60,22 @@ remove_file() # $1 = file to restore
fi
}
if [ -f ~/.shorewallrc ]; then
. ~/shorewallrc || exit 1
if [ -f ./.shorewallrc ]; then
. ./.shorewallrc || exit 1
elif [ -f ~/.shorewallrc ]; then
. ~/.shorewallrc || exit 1
elif [ -r /root/.shorewallrc ]; then
. /root/.shorewallrc || exit 1
elif [ -r /.shorewallrc ]; then
. /root/.shorewallrc || exit 1
elif - -f ${SHOREAWLLRC_HOME}/.shorewallrc; then
. ${SHOREWALLRC_HOME}/.shorewallrc || exit 1
else
SHAREDIR=/usr/share
fi
if [ -f /usr/share/shorewall/coreversion ]; then
INSTALLED_VERSION="$(cat /usr/share/shorewall/coreversion)"
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 " and this is the $VERSION uninstaller."

View File

@ -69,8 +69,16 @@ remove_file() # $1 = file to restore
fi
}
if [ -f ~/.shorewallrc ]; then
. ~/shorewallrc || exit 1
if [ -f ./.shorewallrc ]; then
. ./.shorewallrc || exit 1
elif [ -f ~/.shorewallrc ]; then
. ~/.shorewallrc || exit 1
elif [ -r /root/.shorewallrc ]; then
. /root/.shorewallrc || exit 1
elif [ -r /.shorewallrc ]; then
. /root/.shorewallrc || exit 1
elif - -f ${SHOREAWLLRC_HOME}/.shorewallrc; then
. ${SHOREWALLRC_HOME}/.shorewallrc || exit 1
else
[ -n "${LIBEXEC:=/usr/share}" ]
[ -n "${PERLLIB:=/usr/share/shorewall}" ]

View File

@ -69,8 +69,16 @@ remove_file() # $1 = file to restore
fi
}
if [ -f ~/.shorewallrc ]; then
. ~/shorewallrc || exit 1
if [ -f ./.shorewallrc ]; then
. ./.shorewallrc || exit 1
elif [ -f ~/.shorewallrc ]; then
. ~/.shorewallrc || exit 1
elif [ -r /root/.shorewallrc ]; then
. /root/.shorewallrc || exit 1
elif [ -r /.shorewallrc ]; then
. /root/.shorewallrc || exit 1
elif - -f ${SHOREAWLLRC_HOME}/.shorewallrc; then
. ${SHOREWALLRC_HOME}/.shorewallrc || exit 1
else
[ -n "${LIBEXEC:=/usr/share}" ]
[ -n "${PERLLIB:=/usr/share/shorewall}" ]

View File

@ -69,8 +69,16 @@ remove_file() # $1 = file to restore
fi
}
if [ -f ~/.shorewallrc ]; then
. ~/shorewallrc || exit 1
if [ -f ./.shorewallrc ]; then
. ./.shorewallrc || exit 1
elif [ -f ~/.shorewallrc ]; then
. ~/.shorewallrc || exit 1
elif [ -r /root/.shorewallrc ]; then
. /root/.shorewallrc || exit 1
elif [ -r /.shorewallrc ]; then
. /root/.shorewallrc || exit 1
elif - -f ${SHOREAWLLRC_HOME}/.shorewallrc; then
. ${SHOREWALLRC_HOME}/.shorewallrc || exit 1
else
[ -n "${LIBEXEC:=/usr/share}" ]
[ -n "${PERLLIB:=/usr/share/shorewall}" ]

View File

@ -69,8 +69,16 @@ remove_file() # $1 = file to restore
fi
}
if [ -f ~/.shorewallrc ]; then
. ~/shorewallrc || exit 1
if [ -f ./.shorewallrc ]; then
. ./.shorewallrc || exit 1
elif [ -f ~/.shorewallrc ]; then
. ~/.shorewallrc || exit 1
elif [ -r /root/.shorewallrc ]; then
. /root/.shorewallrc || exit 1
elif [ -r /.shorewallrc ]; then
. /root/.shorewallrc || exit 1
elif - -f ${SHOREAWLLRC_HOME}/.shorewallrc; then
. ${SHOREWALLRC_HOME}/.shorewallrc || exit 1
else
[ -n "${LIBEXEC:=/usr/share}" ]
[ -n "${PERLLIB:=/usr/share/shorewall}" ]

View File

@ -69,8 +69,16 @@ remove_file() # $1 = file to restore
fi
}
if [ -f ~/.shorewallrc ]; then
. ~/shorewallrc || exit 1
if [ -f ./.shorewallrc ]; then
. ./.shorewallrc || exit 1
elif [ -f ~/.shorewallrc ]; then
. ~/.shorewallrc || exit 1
elif [ -r /root/.shorewallrc ]; then
. /root/.shorewallrc || exit 1
elif [ -r /.shorewallrc ]; then
. /root/.shorewallrc || exit 1
elif - -f ${SHOREAWLLRC_HOME}/.shorewallrc; then
. ${SHOREWALLRC_HOME}/.shorewallrc || exit 1
else
[ -n "${LIBEXEC:=/usr/share}" ]
[ -n "${PERLLIB:=/usr/share/shorewall}" ]