Change 'first_install' tests

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2010-04-07 13:16:16 -07:00
parent f17365cf6d
commit 62c9cb7b36
4 changed files with 19 additions and 8 deletions

View File

@ -180,16 +180,23 @@ echo "Installing Shorewall Lite Version $VERSION"
# Check for /etc/shorewall-lite # Check for /etc/shorewall-lite
# #
if [ -z "$PREFIX" -a -d /etc/shorewall-lite ]; then if [ -z "$PREFIX" -a -d /etc/shorewall-lite ]; then
first_install=""
[ -f /etc/shorewall-lite/shorewall.conf ] && \ [ -f /etc/shorewall-lite/shorewall.conf ] && \
mv -f /etc/shorewall-lite/shorewall.conf /etc/shorewall-lite/shorewall-lite.conf mv -f /etc/shorewall-lite/shorewall.conf /etc/shorewall-lite/shorewall-lite.conf
else else
first_install="Yes"
rm -rf ${PREFIX}/etc/shorewall-lite rm -rf ${PREFIX}/etc/shorewall-lite
rm -rf ${PREFIX}/usr/share/shorewall-lite rm -rf ${PREFIX}/usr/share/shorewall-lite
rm -rf ${PREFIX}/var/lib/shorewall-lite rm -rf ${PREFIX}/var/lib/shorewall-lite
fi fi
#
# Check for /sbin/shorewall-lite
#
if [ -f ${PREFIX}/sbin/shorewall-lite ]; then
first_install=""
else
first_install="Yes"
fi
delete_file ${PREFIX}/usr/share/shorewall-lite/xmodules delete_file ${PREFIX}/usr/share/shorewall-lite/xmodules
install_file shorewall-lite ${PREFIX}/sbin/shorewall-lite 0544 ${PREFIX}/var/lib/shorewall-lite-${VERSION}.bkout install_file shorewall-lite ${PREFIX}/sbin/shorewall-lite 0544 ${PREFIX}/var/lib/shorewall-lite-${VERSION}.bkout

View File

@ -209,9 +209,9 @@ cd "$(dirname $0)"
echo "Installing Shorewall Version $VERSION" echo "Installing Shorewall Version $VERSION"
# #
# Check for /etc/shorewall # Check for /sbin/shorewall
# #
if [ -d ${PREFIX}/etc/shorewall ]; then if [ -f ${PREFIX}/sbin/shorewall ]; then
first_install="" first_install=""
else else
first_install="Yes" first_install="Yes"

View File

@ -179,16 +179,20 @@ echo "Installing Shorewall6 Lite Version $VERSION"
# Check for /etc/shorewall6-lite # Check for /etc/shorewall6-lite
# #
if [ -z "$PREFIX" -a -d /etc/shorewall6-lite ]; then if [ -z "$PREFIX" -a -d /etc/shorewall6-lite ]; then
first_install=""
[ -f /etc/shorewall6-lite/shorewall.conf ] && \ [ -f /etc/shorewall6-lite/shorewall.conf ] && \
mv -f /etc/shorewall6-lite/shorewall.conf /etc/shorewall6-lite/shorewall6-lite.conf mv -f /etc/shorewall6-lite/shorewall.conf /etc/shorewall6-lite/shorewall6-lite.conf
else else
first_install="Yes"
rm -rf ${PREFIX}/etc/shorewall6-lite rm -rf ${PREFIX}/etc/shorewall6-lite
rm -rf ${PREFIX}/usr/share/shorewall6-lite rm -rf ${PREFIX}/usr/share/shorewall6-lite
rm -rf ${PREFIX}/var/lib/shorewall6-lite rm -rf ${PREFIX}/var/lib/shorewall6-lite
fi fi
if [ -f ${PREFIX}/sbin/shorewall6-lite ]; then
first_install=""
else
first_install="Yes"
fi
delete_file ${PREFIX}/usr/share/shorewall6-lite/xmodules delete_file ${PREFIX}/usr/share/shorewall6-lite/xmodules
install_file shorewall6-lite ${PREFIX}/sbin/shorewall6-lite 0544 ${PREFIX}/var/lib/shorewall6-lite-${VERSION}.bkout install_file shorewall6-lite ${PREFIX}/sbin/shorewall6-lite 0544 ${PREFIX}/var/lib/shorewall6-lite-${VERSION}.bkout

View File

@ -202,9 +202,9 @@ cd "$(dirname $0)"
echo "Installing Shorewall6 Version $VERSION" echo "Installing Shorewall6 Version $VERSION"
# #
# Check for /etc/shorewall6 # Check for /sbin/shorewall6
# #
if [ -d ${PREFIX}/etc/shorewall6 ]; then if [ -f ${PREFIX}/sbin/shorewall6 ]; then
first_install="" first_install=""
else else
first_install="Yes" first_install="Yes"