Detect and use TAR_CMD

A couple of other programs replaced
Allow unconfigured programs to detect iprange in-situ
This commit is contained in:
Philip Whineray 2015-11-10 07:26:59 +00:00
parent f7c3f430fd
commit d2ec651cdc
7 changed files with 24 additions and 16 deletions

@ -64,9 +64,6 @@ AC_SUBST(FIREHOL_CONFIG_DIR)
PATH=$PATH:/sbin:/usr/sbin PATH=$PATH:/sbin:/usr/sbin
AX_CHECK_PROG([AGGREGATE], [aggregate], [])
AX_CHECK_PROG([AGGREGATE], [aggregate-flim], [])
AX_NEED_PROG([AGGREGATE], [cat], [])
AX_NEED_PROG([BRCTL], [brctl], []) AX_NEED_PROG([BRCTL], [brctl], [])
AX_NEED_PROG([CAT], [cat], []) AX_NEED_PROG([CAT], [cat], [])
AX_NEED_PROG([CHMOD], [chmod], []) AX_NEED_PROG([CHMOD], [chmod], [])
@ -128,6 +125,7 @@ AX_NEED_PROG([SLEEP], [sleep], [])
AX_NEED_PROG([SS], [ss], []) AX_NEED_PROG([SS], [ss], [])
AX_NEED_PROG([SYSCTL], [sysctl], []) AX_NEED_PROG([SYSCTL], [sysctl], [])
AX_NEED_PROG([TAIL], [tail], []) AX_NEED_PROG([TAIL], [tail], [])
AX_NEED_PROG([TAR], [tar], [])
AX_NEED_PROG([TOUCH], [touch], []) AX_NEED_PROG([TOUCH], [touch], [])
AX_NEED_PROG([TR], [tr], []) AX_NEED_PROG([TR], [tr], [])
AX_NEED_PROG([UNAME], [uname], []) AX_NEED_PROG([UNAME], [uname], [])

@ -85,7 +85,7 @@ fi
#cat $MYTMP/files.lst #cat $MYTMP/files.lst
dirname="${0%/*}" dirname="${0%/*}"
if [ "$dir" = "$0" ]; then dir="."; fi if [ "$dirname" = "$0" ]; then dirname="."; fi
source $dirname/check-files.functions source $dirname/check-files.functions
status=0 status=0

@ -979,7 +979,9 @@ do
then then
eval $cmd_var=\"$autoconf\" eval $cmd_var=\"$autoconf\"
else else
PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH" which_all $cmd_var "$possibles" dirname="${0%/*}"
if [ "$dirname" = "$0" ]; then dirname="."; fi
PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH:$dirname" which_all $cmd_var "$possibles"
fi fi
if [ "$required" = "Y" ] if [ "$required" = "Y" ]
then then

@ -253,7 +253,9 @@ do
then then
eval $cmd_var=\"$autoconf\" eval $cmd_var=\"$autoconf\"
else else
PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH" which_all $cmd_var "$possibles" dirname="${0%/*}"
if [ "$dirname" = "$0" ]; then dirname="."; fi
PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH:$dirname" which_all $cmd_var "$possibles"
fi fi
if [ "$required" = "Y" ] if [ "$required" = "Y" ]
then then

@ -276,7 +276,9 @@ do
then then
eval $cmd_var=\"$autoconf\" eval $cmd_var=\"$autoconf\"
else else
PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH" which_all $cmd_var "$possibles" dirname="${0%/*}"
if [ "$dirname" = "$0" ]; then dirname="."; fi
PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH:$dirname" which_all $cmd_var "$possibles"
fi fi
if [ "$required" = "Y" ] if [ "$required" = "Y" ]
then then
@ -315,7 +317,7 @@ N|HEAD_CMD|@HEAD@|head
N|TPUT_CMD|@TPUT@|tput N|TPUT_CMD|@TPUT@|tput
N|WGET_CMD|@WGET@|wget N|WGET_CMD|@WGET@|wget
N|SCREEN_CMD|@SCREEN@|screen N|SCREEN_CMD|@SCREEN@|screen
Y|AGGREGATE_CMD|@AGGREGATE@|aggregate aggregate-flim cat Y|IPRANGE_CMD|@IPRANGE@|iprange
! !
VERSION=$(get_version) VERSION=$(get_version)
@ -1854,7 +1856,7 @@ asips() {
$JQ_CMD .data.prefixes[].prefix |\ $JQ_CMD .data.prefixes[].prefix |\
$SED_CMD -e 's| ||g' -e 's|"||g' |\ $SED_CMD -e 's| ||g' -e 's|"||g' |\
$EGREP_CMD "^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/[0-9]+" |\ $EGREP_CMD "^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/[0-9]+" |\
$AGGREGATE_CMD $IPRANGE_CMD
} }
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------

@ -251,7 +251,9 @@ do
then then
eval $cmd_var=\"$autoconf\" eval $cmd_var=\"$autoconf\"
else else
PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH" which_all $cmd_var "$possibles" dirname="${0%/*}"
if [ "$dirname" = "$0" ]; then dirname="."; fi
PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH:$dirname" which_all $cmd_var "$possibles"
fi fi
if [ "$required" = "Y" ] if [ "$required" = "Y" ]
then then
@ -292,6 +294,7 @@ Y|FIND_CMD|@FIND@|find
Y|WC_CMD|@WC@|wc Y|WC_CMD|@WC@|wc
Y|MV_CMD|@MV@|mv Y|MV_CMD|@MV@|mv
Y|CP_CMD|@CP@|cp Y|CP_CMD|@CP@|cp
Y|TAR_CMD|@TAR@|tar
Y|IPSET_CMD|@IPSET@|ipset Y|IPSET_CMD|@IPSET@|ipset
N|UNZIP_CMD|@UNZIP@|unzip N|UNZIP_CMD|@UNZIP@|unzip
N|FUNZIP_CMD|@FUNZIP@|funzip N|FUNZIP_CMD|@FUNZIP@|funzip
@ -675,7 +678,7 @@ options are:
Will only process the given ipsets. Will only process the given ipsets.
This parameter must be the last in command line, it This parameter must be the last in command line, it
assumes all parameters after the keyword 'run' are assumes all parameters after the keyword 'run' are
ipset names. ipsets names.
EOFUSAGE EOFUSAGE
} }
@ -960,7 +963,7 @@ git_checkout_or_add() {
git_ignore_file() { git_ignore_file() {
local file="${1}" local file="${1}"
local found=$(cat "${BASE_DIR}/.gitignore" | grep "^${file}$$") local found=$($CAT_CMD "${BASE_DIR}/.gitignore" | $GREP_CMD "^${file}$$")
if [ -z "${found}" ] if [ -z "${found}" ]
then then
echo "${file}" >>"${BASE_DIR}/.gitignore" || return 1 echo "${file}" >>"${BASE_DIR}/.gitignore" || return 1
@ -3662,9 +3665,8 @@ ipdeny_country() {
$MKDIR_CMD "${BASE_DIR}/${ipset}" || return 1 $MKDIR_CMD "${BASE_DIR}/${ipset}" || return 1
fi fi
# FIXME - tar to TAR_CMD
# extract it # extract it
tar -zxpf "${BASE_DIR}/${ipset}.source" $TAR_CMD -zxpf "${BASE_DIR}/${ipset}.source"
# move them inside the tmp, and fix continents # move them inside the tmp, and fix continents
local x= local x=
@ -6468,7 +6470,7 @@ do
fi fi
verbose "Loading ipset definitions from: '${supplied_ipsets_dir}'" verbose "Loading ipset definitions from: '${supplied_ipsets_dir}'"
for supplied_ipset_file in $(ls "${supplied_ipsets_dir}"/*.conf 2>/dev/null) for supplied_ipset_file in $($LS_CMD "${supplied_ipsets_dir}"/*.conf 2>/dev/null)
do do
verbose "Loading ipset definition file: '${supplied_ipset_file}'" verbose "Loading ipset definition file: '${supplied_ipset_file}'"

@ -200,7 +200,9 @@ do
then then
eval $cmd_var=\"$autoconf\" eval $cmd_var=\"$autoconf\"
else else
PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH" which_all $cmd_var "$possibles" dirname="${0%/*}"
if [ "$dirname" = "$0" ]; then dirname="."; fi
PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH:$dirname" which_all $cmd_var "$possibles"
fi fi
if [ "$required" = "Y" ] if [ "$required" = "Y" ]
then then