diff options
author | TheJackiMonster <thejackimonster@gmail.com> | 2021-05-03 10:28:49 +0200 |
---|---|---|
committer | TheJackiMonster <thejackimonster@gmail.com> | 2021-05-03 10:28:49 +0200 |
commit | ae3ce5eaf5df138e41337c7cf4d964a031b3008d (patch) | |
tree | 41a23246e5a0cd9591cd0733a9887e54fadcbce0 /contrib/scripts/netjail/netjail_core.sh | |
parent | 5831a14819679c841db1f7cbd78d42aef3f61b06 (diff) |
-added binary check to netjail and set stunserver fixed
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
Diffstat (limited to 'contrib/scripts/netjail/netjail_core.sh')
-rwxr-xr-x | contrib/scripts/netjail/netjail_core.sh | 14 |
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} } |