Signed-off-by: Matt Darfeuille <[email protected]>
---
Shorewall-core/uninstall.sh | 36 +++++------------------------------
Shorewall-init/uninstall.sh | 45 +++++---------------------------------------
Shorewall-lite/uninstall.sh | 43 ++++--------------------------------------
Shorewall/uninstall.sh | 45 +++++---------------------------------------
Shorewall6-lite/uninstall.sh | 45 +++++---------------------------------------
Shorewall6/uninstall.sh | 45 +++++---------------------------------------
6 files changed, 29 insertions(+), 230 deletions(-)
diff --git a/Shorewall-core/uninstall.sh b/Shorewall-core/uninstall.sh
index d55093d..2a12252 100755
--- a/Shorewall-core/uninstall.sh
+++ b/Shorewall-core/uninstall.sh
@@ -37,43 +37,17 @@ usage() # $1 = exit status
exit $1
}
-fatal_error()
-{
- echo " ERROR: $@" >&2
- exit 1
-}
-
-qt()
-{
- "$@" >/dev/null 2>&1
-}
-
-restore_file() # $1 = file to restore
-{
- if [ -f ${1}-shorewall.bkout ]; then
- if (mv -f ${1}-shorewall.bkout $1); then
- echo
- echo "$1 restored"
- else
- exit 1
- fi
- fi
-}
-
-remove_file() # $1 = file to restore
-{
- if [ -f $1 -o -L $1 ] ; then
- rm -f $1
- echo "$1 Removed"
- fi
-}
-
#
# Change to the directory containing this script
#
cd "$(dirname $0)"
#
+# Source common functions
+#
+. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2;
exit 1; }
+
+#
# Read the RC file
#
if [ $# -eq 0 ]; then
diff --git a/Shorewall-init/uninstall.sh b/Shorewall-init/uninstall.sh
index b7cdfec..76de74a 100755
--- a/Shorewall-init/uninstall.sh
+++ b/Shorewall-init/uninstall.sh
@@ -37,51 +37,16 @@ usage() # $1 = exit status
exit $1
}
-fatal_error()
-{
- echo " ERROR: $@" >&2
- exit 1
-}
-
-qt()
-{
- "$@" >/dev/null 2>&1
-}
-
-split() {
- local ifs
- ifs=$IFS
- IFS=:
- set -- $1
- echo $*
- IFS=$ifs
-}
-
-mywhich() {
- local dir
-
- for dir in $(split $PATH); do
- if [ -x $dir/$1 ]; then
- return 0
- fi
- done
-
- return 2
-}
-
-remove_file() # $1 = file to restore
-{
- if [ -f $1 -o -L $1 ] ; then
- rm -f $1
- echo "$1 Removed"
- fi
-}
-
#
# Change to the directory containing this script
#
cd "$(dirname $0)"
+#
+# Source common functions
+#
+. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2;
exit 1; }
+
finished=0
configure=1
diff --git a/Shorewall-lite/uninstall.sh b/Shorewall-lite/uninstall.sh
index 546679f..853ffe7 100755
--- a/Shorewall-lite/uninstall.sh
+++ b/Shorewall-lite/uninstall.sh
@@ -41,45 +41,10 @@ usage() # $1 = exit status
exit $1
}
-fatal_error()
-{
- echo " ERROR: $@" >&2
- exit 1
-}
-
-qt()
-{
- "$@" >/dev/null 2>&1
-}
-
-split() {
- local ifs
- ifs=$IFS
- IFS=:
- set -- $1
- echo $*
- IFS=$ifs
-}
-
-mywhich() {
- local dir
-
- for dir in $(split $PATH); do
- if [ -x $dir/$1 ]; then
- return 0
- fi
- done
-
- return 2
-}
-
-remove_file() # $1 = file to restore
-{
- if [ -f $1 -o -L $1 ] ; then
- rm -f $1
- echo "$1 Removed"
- fi
-}
+#
+# Source common functions
+#
+. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2;
exit 1; }
finished=0
configure=1
diff --git a/Shorewall/uninstall.sh b/Shorewall/uninstall.sh
index eb6975d..f291b7f 100755
--- a/Shorewall/uninstall.sh
+++ b/Shorewall/uninstall.sh
@@ -41,51 +41,16 @@ usage() # $1 = exit status
exit $1
}
-fatal_error()
-{
- echo " ERROR: $@" >&2
- exit 1
-}
-
-qt()
-{
- "$@" >/dev/null 2>&1
-}
-
-split() {
- local ifs
- ifs=$IFS
- IFS=:
- set -- $1
- echo $*
- IFS=$ifs
-}
-
-mywhich() {
- local dir
-
- for dir in $(split $PATH); do
- if [ -x $dir/$1 ]; then
- return 0
- fi
- done
-
- return 2
-}
-
-remove_file() # $1 = file to restore
-{
- if [ -f $1 -o -L $1 ] ; then
- rm -f $1
- echo "$1 Removed"
- fi
-}
-
#
# Change to the directory containing this script
#
cd "$(dirname $0)"
+#
+# Source common functions
+#
+. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2;
exit 1; }
+
finished=0
configure=1
diff --git a/Shorewall6-lite/uninstall.sh b/Shorewall6-lite/uninstall.sh
index 0c4495a..6d0ee50 100755
--- a/Shorewall6-lite/uninstall.sh
+++ b/Shorewall6-lite/uninstall.sh
@@ -37,51 +37,16 @@ usage() # $1 = exit status
exit $1
}
-fatal_error()
-{
- echo " ERROR: $@" >&2
- exit 1
-}
-
-qt()
-{
- "$@" >/dev/null 2>&1
-}
-
-split() {
- local ifs
- ifs=$IFS
- IFS=:
- set -- $1
- echo $*
- IFS=$ifs
-}
-
-mywhich() {
- local dir
-
- for dir in $(split $PATH); do
- if [ -x $dir/$1 ]; then
- return 0
- fi
- done
-
- return 2
-}
-
-remove_file() # $1 = file to restore
-{
- if [ -f $1 -o -L $1 ] ; then
- rm -f $1
- echo "$1 Removed"
- fi
-}
-
#
# Change to the directory containing this script
#
cd "$(dirname $0)"
+#
+# Source common functions
+#
+. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2;
exit 1; }
+
finished=0
configure=1
diff --git a/Shorewall6/uninstall.sh b/Shorewall6/uninstall.sh
index f89f09f..20ac1c2 100755
--- a/Shorewall6/uninstall.sh
+++ b/Shorewall6/uninstall.sh
@@ -37,51 +37,16 @@ usage() # $1 = exit status
exit $1
}
-fatal_error()
-{
- echo " ERROR: $@" >&2
- exit 1
-}
-
-qt()
-{
- "$@" >/dev/null 2>&1
-}
-
-split() {
- local ifs
- ifs=$IFS
- IFS=:
- set -- $1
- echo $*
- IFS=$ifs
-}
-
-mywhich() {
- local dir
-
- for dir in $(split $PATH); do
- if [ -x $dir/$1 ]; then
- return 0
- fi
- done
-
- return 2
-}
-
-remove_file() # $1 = file to restore
-{
- if [ -f $1 -o -L $1 ] ; then
- rm -f $1
- echo "$1 Removed"
- fi
-}
-
#
# Change to the directory containing this script
#
cd "$(dirname $0)"
+#
+# Source common functions
+#
+. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2;
exit 1; }
+
finished=0
configure=1
--
2.8.3
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Shorewall-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-devel