mirror of
https://github.com/firehol/firehol.git
synced 2024-06-28 18:02:33 +00:00
Validate that all commands exist and can execute
We will output a message indicating what can be done if this occurs
This commit is contained in:
parent
768ccdf4c6
commit
d63e61c3c3
@ -925,6 +925,21 @@ require_cmd() {
|
||||
eval val=\$\{${var}\}
|
||||
if [ "${val}" ]
|
||||
then
|
||||
local cmd=$(echo $val | cut -f1 -d' ')
|
||||
if [ ! -x "$cmd" ]
|
||||
then
|
||||
echo >&2
|
||||
if [ $block -eq 0 ]
|
||||
then
|
||||
echo >&2 "WARNING: optional command does not exist or is not executable ($cmd)"
|
||||
echo >&2 "please add or correct $var in firehol-defaults.conf"
|
||||
val=""
|
||||
else
|
||||
echo >&2 "ERROR: required command does not exist or is not executable ($cmd)"
|
||||
echo >&2 "please add or correct $var in firehol-defaults.conf"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
return 0
|
||||
elif [ $block -eq 0 ]
|
||||
then
|
||||
@ -991,7 +1006,7 @@ do
|
||||
if [ "$set_in_defaults" ]
|
||||
then
|
||||
:
|
||||
elif [ "@AUTOCONF_RUN@" = "Y" -a ! -z "$autoconf" -a -x "$autoconf" ]
|
||||
elif [ "@AUTOCONF_RUN@" = "Y" -a ! -z "$autoconf" ]
|
||||
then
|
||||
eval $cmd_var=\"$autoconf\"
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user