forked from extern/shorewall_code
Always set IPSET in get_config()
- Previously, lib.cli-std set the variable but lib.cli did not. Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
4311dc5ddf
commit
a12f1f9fbb
@ -507,7 +507,7 @@ find_sets() {
|
|||||||
local junk
|
local junk
|
||||||
local setname
|
local setname
|
||||||
|
|
||||||
ipset -L -n | grep "^Name: ${1}_" | while read junk setname; do echo $setname; done
|
$IPSET -L | grep "^Name: ${1}_" | while read junk setname; do echo $setname; done
|
||||||
}
|
}
|
||||||
|
|
||||||
list_zone() {
|
list_zone() {
|
||||||
@ -515,22 +515,24 @@ list_zone() {
|
|||||||
local sets
|
local sets
|
||||||
local setname
|
local setname
|
||||||
|
|
||||||
[ -n "$(mywhich ipset)" ] || fatal_error "The ipset utility cannot be located"
|
if [ $IPSET = ipset ]; then
|
||||||
|
[ -n "$(mywhich ipset)" ] || fatal_error "The ipset utility cannot be located"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ $g_family -eq 4 ]; then
|
if [ $g_family -eq 4 ]; then
|
||||||
sets=$(ipset -L -n | grep '^$1_');
|
sets=$($IPSET -L | grep '^$1_');
|
||||||
else
|
else
|
||||||
sets=$(ipset -L -n | grep "^6_$1_")
|
sets=$($IPSET-L | grep "^6_$1_")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ -n "$sets" ] || sets=$(find_sets $1)
|
[ -n "$sets" ] || sets=$(find_sets $1)
|
||||||
|
|
||||||
for setname in $sets; do
|
for setname in $sets; do
|
||||||
echo "${setname#${1}_}:"
|
echo "${setname#${1}_}:"
|
||||||
ipset -L $setname -n | awk 'BEGIN {prnt=0;}; \
|
$IPSET -L $setname | awk 'BEGIN {prnt=0;}; \
|
||||||
/^Members:/ {prnt=1; next; }; \
|
/^Members:/ {prnt=1; next; }; \
|
||||||
/^Bindings:/ {prnt=0; }; \
|
/^Bindings:/ {prnt=0; }; \
|
||||||
{ if (prnt == 1) print " ", $1; };'
|
{ if (prnt == 1) print " ", $1; };'
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2846,6 +2848,27 @@ get_config() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -n "$IPSET" ]; then
|
||||||
|
case "$IPSET" in
|
||||||
|
*/*)
|
||||||
|
if [ ! -x "$IPSET" ] ; then
|
||||||
|
echo " ERROR: The program specified in IPSET ($IPSET) does not exist or is not executable" >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
prog="$(mywhich $IPSET 2> /dev/null)"
|
||||||
|
if [ -z "$prog" ] ; then
|
||||||
|
echo " ERROR: Can't find $IPSET executable" >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
IPSET=$prog
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
IPSET='ipset'
|
||||||
|
fi
|
||||||
|
|
||||||
[ -n "$RESTOREFILE" ] || RESTOREFILE=restore
|
[ -n "$RESTOREFILE" ] || RESTOREFILE=restore
|
||||||
|
|
||||||
validate_restorefile RESTOREFILE
|
validate_restorefile RESTOREFILE
|
||||||
|
Loading…
Reference in New Issue
Block a user