summaryrefslogtreecommitdiff
path: root/contrib/scripts/netjail/netjail_core.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/scripts/netjail/netjail_core.sh')
-rwxr-xr-xcontrib/scripts/netjail/netjail_core.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/contrib/scripts/netjail/netjail_core.sh b/contrib/scripts/netjail/netjail_core.sh
index a3271a3e4..cbf25434b 100755
--- a/contrib/scripts/netjail/netjail_core.sh
+++ b/contrib/scripts/netjail/netjail_core.sh
@@ -44,6 +44,20 @@ netjail_check() {
fi
}
+netjail_check_bin() {
+ PROGRAM=$1
+
+ MATCH=$(ls $(echo $PATH | tr ":" "\n") | grep "^$PROGRAM\$" | tr "\n" " " | awk '{ print $1 }')
+
+ # quit if the required binary $PROGRAM can not be
+ # found in the used $PATH.
+
+ if [ "$MATCH" != "$PROGRAM" ]; then
+ echo "Required binary not found: $PROGRAM" >&2
+ exit 1
+ fi
+}
+
netjail_print_name() {
printf "%s%02x%02x" $1 $2 ${3:-0}
}