Don't default IPSET to 'ipset'.

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2012-11-09 08:54:54 -08:00
parent 860ee6de27
commit 5fcdfd779c
4 changed files with 12 additions and 25 deletions

View File

@ -525,7 +525,7 @@ show_routing() {
determine_ipset_version() { determine_ipset_version() {
local setname local setname
if [ $IPSET = ipset ]; then if [ -z "$IPSET" -o $IPSET = ipset ]; then
IPSET=$(mywhich ipset) IPSET=$(mywhich ipset)
[ -n "$IPSET" ] || fatal_error "The ipset utility cannot be located" [ -n "$IPSET" ] || fatal_error "The ipset utility cannot be located"
fi fi
@ -2956,27 +2956,6 @@ 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
@ -3017,7 +2996,7 @@ get_config() {
;; ;;
esac esac
else else
IPSET='ipset' IPSET=''
fi fi
TC=tc TC=tc

View File

@ -84,7 +84,7 @@ get_script_version() { # $1 = script
temp=$( $SHOREWALL_SHELL $1 version | tail -n 1 | sed 's/-.*//' ) temp=$( $SHOREWALL_SHELL $1 version | tail -n 1 | sed 's/-.*//' )
if [ $? -ne 0 ]; then if [ -z "$temp" ]; then
version=0 version=0
else else
ifs=$IFS ifs=$IFS

View File

@ -4564,6 +4564,8 @@ sub get_configuration( $$$ ) {
default_yes_no 'AUTOHELPERS' , 'Yes'; default_yes_no 'AUTOHELPERS' , 'Yes';
default_yes_no 'RESTORE_ROUTEMARKS' , 'Yes'; default_yes_no 'RESTORE_ROUTEMARKS' , 'Yes';
$config{IPSET} = '' if supplied $config{IPSET} && $config{IPSET} eq 'ipset';
if ( supplied $config{HELPERS} ) { if ( supplied $config{HELPERS} ) {
my %helpers_temp = %helpers_enabled; my %helpers_temp = %helpers_enabled;

View File

@ -136,6 +136,12 @@ get_config() {
exit 2 exit 2
fi fi
;; ;;
ipset)
#
# Old config files had this as default
#
IPSET=''
;;
*) *)
prog="$(mywhich $IPSET 2> /dev/null)" prog="$(mywhich $IPSET 2> /dev/null)"
if [ -z "$prog" ] ; then if [ -z "$prog" ] ; then
@ -146,7 +152,7 @@ get_config() {
;; ;;
esac esac
else else
IPSET='ipset' IPSET=''
fi fi
if [ -n "$TC" ]; then if [ -n "$TC" ]; then