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) | |
download | gnunet-ae3ce5eaf5df138e41337c7cf4d964a031b3008d.tar.gz gnunet-ae3ce5eaf5df138e41337c7cf4d964a031b3008d.zip |
-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() { | |||
44 | fi | 44 | fi |
45 | } | 45 | } |
46 | 46 | ||
47 | netjail_check_bin() { | ||
48 | PROGRAM=$1 | ||
49 | |||
50 | MATCH=$(ls $(echo $PATH | tr ":" "\n") | grep "^$PROGRAM\$" | tr "\n" " " | awk '{ print $1 }') | ||
51 | |||
52 | # quit if the required binary $PROGRAM can not be | ||
53 | # found in the used $PATH. | ||
54 | |||
55 | if [ "$MATCH" != "$PROGRAM" ]; then | ||
56 | echo "Required binary not found: $PROGRAM" >&2 | ||
57 | exit 1 | ||
58 | fi | ||
59 | } | ||
60 | |||
47 | netjail_print_name() { | 61 | netjail_print_name() { |
48 | printf "%s%02x%02x" $1 $2 ${3:-0} | 62 | printf "%s%02x%02x" $1 $2 ${3:-0} |
49 | } | 63 | } |