mirror of
https://gitlab.com/shorewall/code.git
synced 2025-02-18 02:31:11 +01:00
Load uninstallers's common functions
Signed-off-by: Matt Darfeuille <matdarf@gmail.com> Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
4e771083c7
commit
20cc56f2f1
@ -37,42 +37,16 @@ usage() # $1 = exit status
|
|||||||
exit $1
|
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
|
# Change to the directory containing this script
|
||||||
#
|
#
|
||||||
cd "$(dirname $0)"
|
cd "$(dirname $0)"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Source common functions
|
||||||
|
#
|
||||||
|
. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2; exit 1; }
|
||||||
|
|
||||||
#
|
#
|
||||||
# Read the RC file
|
# Read the RC file
|
||||||
#
|
#
|
||||||
|
@ -37,51 +37,16 @@ usage() # $1 = exit status
|
|||||||
exit $1
|
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
|
# Change to the directory containing this script
|
||||||
#
|
#
|
||||||
cd "$(dirname $0)"
|
cd "$(dirname $0)"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Source common functions
|
||||||
|
#
|
||||||
|
. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2; exit 1; }
|
||||||
|
|
||||||
finished=0
|
finished=0
|
||||||
configure=1
|
configure=1
|
||||||
|
|
||||||
|
@ -41,45 +41,10 @@ usage() # $1 = exit status
|
|||||||
exit $1
|
exit $1
|
||||||
}
|
}
|
||||||
|
|
||||||
fatal_error()
|
#
|
||||||
{
|
# Source common functions
|
||||||
echo " ERROR: $@" >&2
|
#
|
||||||
exit 1
|
. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&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
|
|
||||||
}
|
|
||||||
|
|
||||||
finished=0
|
finished=0
|
||||||
configure=1
|
configure=1
|
||||||
|
@ -41,51 +41,16 @@ usage() # $1 = exit status
|
|||||||
exit $1
|
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
|
# Change to the directory containing this script
|
||||||
#
|
#
|
||||||
cd "$(dirname $0)"
|
cd "$(dirname $0)"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Source common functions
|
||||||
|
#
|
||||||
|
. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2; exit 1; }
|
||||||
|
|
||||||
finished=0
|
finished=0
|
||||||
configure=1
|
configure=1
|
||||||
|
|
||||||
|
@ -37,51 +37,16 @@ usage() # $1 = exit status
|
|||||||
exit $1
|
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
|
# Change to the directory containing this script
|
||||||
#
|
#
|
||||||
cd "$(dirname $0)"
|
cd "$(dirname $0)"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Source common functions
|
||||||
|
#
|
||||||
|
. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2; exit 1; }
|
||||||
|
|
||||||
finished=0
|
finished=0
|
||||||
configure=1
|
configure=1
|
||||||
|
|
||||||
|
@ -37,51 +37,16 @@ usage() # $1 = exit status
|
|||||||
exit $1
|
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
|
# Change to the directory containing this script
|
||||||
#
|
#
|
||||||
cd "$(dirname $0)"
|
cd "$(dirname $0)"
|
||||||
|
|
||||||
|
#
|
||||||
|
# Source common functions
|
||||||
|
#
|
||||||
|
. ./lib.uninstaller || { echo "ERROR: Can not load common functions." >&2; exit 1; }
|
||||||
|
|
||||||
finished=0
|
finished=0
|
||||||
configure=1
|
configure=1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user