forked from extern/shorewall_code
Remove 'fallback' capability
git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@9486 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
parent
0e8d2452d0
commit
2ba3272ebc
@ -1,104 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Script to back out the installation of Shoreline Firewall and to restore the previous version of
|
||||
# the program
|
||||
#
|
||||
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
||||
#
|
||||
# (c) 2001,2002,2003,2004,2005 - Tom Eastep (teastep@shorewall.net)
|
||||
#
|
||||
# Shorewall documentation is available at http://shorewall.net
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of Version 2 of the GNU General Public License
|
||||
# as published by the Free Software Foundation.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# You may only use this script to back out the installation of the version
|
||||
# shown below. Simply run this script to revert to your prior version of
|
||||
# Shoreline Firewall.
|
||||
|
||||
VERSION=4.2.6
|
||||
|
||||
usage() # $1 = exit status
|
||||
{
|
||||
echo "usage: $(basename $0)"
|
||||
exit $1
|
||||
}
|
||||
|
||||
restore_directory() # $1 = directory to restore
|
||||
{
|
||||
if [ -d ${1}-${VERSION}.bkout ]; then
|
||||
if mv -f $1 ${1}-${VERSION} && mv ${1}-${VERSION}.bkout $1; then
|
||||
echo
|
||||
echo "$1 restored"
|
||||
rm -rf ${1}-${VERSION}
|
||||
else
|
||||
echo "ERROR: Could not restore $1"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
restore_file() # $1 = file to restore, $2 = (Optional) Directory to restore from
|
||||
{
|
||||
if [ -n "$2" ]; then
|
||||
local file
|
||||
file=$(basename $1)
|
||||
|
||||
if [ -f $2/$file ]; then
|
||||
if mv -f $2/$file $1 ; then
|
||||
echo
|
||||
echo "$1 restored"
|
||||
return
|
||||
fi
|
||||
|
||||
echo "ERROR: Could not restore $1"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f ${1}-${VERSION}.bkout -o -L ${1}-${VERSION}.bkout ]; then
|
||||
if (mv -f ${1}-${VERSION}.bkout $1); then
|
||||
echo
|
||||
echo "$1 restored"
|
||||
else
|
||||
echo "ERROR: Could not restore $1"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
if [ ! -f /usr/share/shorewall-${VERSION}.bkout/version ]; then
|
||||
echo "Shorewall Version $VERSION is not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Backing Out Installation of Shorewall $VERSION"
|
||||
|
||||
if [ -L /usr/share/shorewall/init ]; then
|
||||
FIREWALL=$(ls -l /usr/share/shorewall/init | sed 's/^.*> //')
|
||||
restore_file $FIREWALL /usr/share/shorewall-${VERSION}.bkout
|
||||
else
|
||||
restore_file /etc/init.d/shorewall /usr/share/shorewall-${VERSION}.bkout
|
||||
fi
|
||||
|
||||
restore_file /sbin/shorewall /var/lib/shorewall-${VERSION}.bkout
|
||||
|
||||
restore_directory /etc/shorewall
|
||||
restore_directory /usr/share/shorewall
|
||||
restore_directory /var/lib/shorewall
|
||||
|
||||
echo "Shorewall Restored to Version $(cat /usr/share/shorewall/version)"
|
||||
|
||||
|
@ -76,41 +76,6 @@ cant_autostart()
|
||||
echo "WARNING: Unable to configure shorewall to start automatically at boot" >&2
|
||||
}
|
||||
|
||||
backup_directory() # $1 = directory to backup
|
||||
{
|
||||
if [ -d $1 ]; then
|
||||
if cp -a $1 ${1}-${VERSION}.bkout ; then
|
||||
echo
|
||||
echo "$1 saved to ${1}-${VERSION}.bkout"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
backup_file() # $1 = file to backup, $2 = (optional) Directory in which to create the backup
|
||||
{
|
||||
if [ -z "${PREFIX}{NOBACKUP}" ]; then
|
||||
if [ -f $1 -a ! -f ${1}-${VERSION}.bkout ]; then
|
||||
if [ -n "$2" ]; then
|
||||
if [ -d $2 ]; then
|
||||
if cp -f $1 $2 ; then
|
||||
echo
|
||||
echo "$1 saved to $2/$(basename $1)"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
elif cp $1 ${1}-${VERSION}.bkout; then
|
||||
echo
|
||||
echo "$1 saved to ${1}-${VERSION}.bkout"
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
delete_file() # $1 = file to delete
|
||||
{
|
||||
rm -f $1
|
||||
@ -121,12 +86,6 @@ install_file() # $1 = source $2 = target $3 = mode
|
||||
run_install $OWNERSHIP -m $3 $1 ${2}
|
||||
}
|
||||
|
||||
install_file_with_backup() # $1 = source $2 = target $3 = mode $4 = (optional) backup directory
|
||||
{
|
||||
backup_file $2 $4
|
||||
run_install $OWNERSHIP -m $3 $1 ${2}
|
||||
}
|
||||
|
||||
#
|
||||
# Parse the run line
|
||||
#
|
||||
@ -169,8 +128,6 @@ esac
|
||||
|
||||
OWNERSHIP="-o $OWNER -g $GROUP"
|
||||
|
||||
NOBACKUP=
|
||||
|
||||
while [ $# -gt 0 ] ; do
|
||||
case "$1" in
|
||||
-h|help|?)
|
||||
@ -180,9 +137,6 @@ while [ $# -gt 0 ] ; do
|
||||
echo "Shorewall Firewall Installer Version $VERSION"
|
||||
exit 0
|
||||
;;
|
||||
-n)
|
||||
NOBACKUP=Yes
|
||||
;;
|
||||
*)
|
||||
usage 1
|
||||
;;
|
||||
@ -238,20 +192,15 @@ echo "Installing Shorewall-common Version $VERSION"
|
||||
#
|
||||
if [ -d ${PREFIX}/etc/shorewall ]; then
|
||||
first_install=""
|
||||
if [ -z "$NOBACKUP" ]; then
|
||||
backup_directory ${PREFIX}/etc/shorewall
|
||||
backup_directory ${PREFIX}/usr/share/shorewall
|
||||
backup_directory ${PREFIX}/var/lib/shorewall
|
||||
fi
|
||||
else
|
||||
first_install="Yes"
|
||||
fi
|
||||
|
||||
if [ -z "$CYGWIN" ]; then
|
||||
install_file_with_backup shorewall ${PREFIX}/sbin/shorewall 0755 ${PREFIX}/var/lib/shorewall-${VERSION}.bkout
|
||||
install_file shorewall ${PREFIX}/sbin/shorewall 0755 ${PREFIX}/var/lib/shorewall-${VERSION}.bkout
|
||||
echo "shorewall control program installed in ${PREFIX}/sbin/shorewall"
|
||||
else
|
||||
install_file_with_backup shorewall ${PREFIX}/bin/shorewall 0755 ${PREFIX}/var/lib/shorewall-${VERSION}.bkout
|
||||
install_file shorewall ${PREFIX}/bin/shorewall 0755 ${PREFIX}/var/lib/shorewall-${VERSION}.bkout
|
||||
echo "shorewall control program installed in ${PREFIX}/bin/shorewall"
|
||||
fi
|
||||
|
||||
@ -260,14 +209,14 @@ fi
|
||||
# Install the Firewall Script
|
||||
#
|
||||
if [ -n "$DEBIAN" ]; then
|
||||
install_file_with_backup init.debian.sh /etc/init.d/shorewall 0544 ${PREFIX}/usr/share/shorewall-${VERSION}.bkout
|
||||
install_file init.debian.sh /etc/init.d/shorewall 0544 ${PREFIX}/usr/share/shorewall-${VERSION}.bkout
|
||||
elif [ -n "$ARCHLINUX" ]; then
|
||||
install_file_with_backup init.archlinux.sh ${PREFIX}${DEST}/$INIT 0544 ${PREFIX}/usr/share/shorewall-${VERSION}.bkout
|
||||
install_file init.archlinux.sh ${PREFIX}${DEST}/$INIT 0544 ${PREFIX}/usr/share/shorewall-${VERSION}.bkout
|
||||
elif [ -n "$SLACKWARE" ]; then
|
||||
install_file_with_backup init.slackware.firewall.sh ${PREFIX}${DEST}/rc.firewall 0644 ${PREFIX}/usr/share/shorewall-${VERSION}.bkout
|
||||
install_file_with_backup init.slackware.shorewall.sh ${PREFIX}${DEST}/rc.shorewall 0644 ${PREFIX}/usr/share/shorewall-${VERSION}.bkout
|
||||
install_file init.slackware.firewall.sh ${PREFIX}${DEST}/rc.firewall 0644 ${PREFIX}/usr/share/shorewall-${VERSION}.bkout
|
||||
install_file init.slackware.shorewall.sh ${PREFIX}${DEST}/rc.shorewall 0644 ${PREFIX}/usr/share/shorewall-${VERSION}.bkout
|
||||
elif [ -n "$INIT" ]; then
|
||||
install_file_with_backup init.sh ${PREFIX}${DEST}/$INIT 0544 ${PREFIX}/usr/share/shorewall-${VERSION}.bkout
|
||||
install_file init.sh ${PREFIX}${DEST}/$INIT 0544 ${PREFIX}/usr/share/shorewall-${VERSION}.bkout
|
||||
fi
|
||||
|
||||
[ -n "$CYGWIN" ] || echo "Shorewall script installed in ${PREFIX}${DEST}/$INIT"
|
||||
|
@ -26,7 +26,7 @@
|
||||
# You may only use this script to uninstall the version
|
||||
# shown below. Simply run this script to remove Shorewall Firewall
|
||||
|
||||
VERSION=4.2.6
|
||||
VERSION=4.2.7
|
||||
|
||||
usage() # $1 = exit status
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user