diff options
Diffstat (limited to 'bin/problem-7.sh')
| -rwxr-xr-x | bin/problem-7.sh | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/bin/problem-7.sh b/bin/problem-7.sh deleted file mode 100755 index 8cb15ce..0000000 --- a/bin/problem-7.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -if [ $# -eq 0 ]; then - echo "error: a hostname is required" >&2 - exit 1 -fi - -check() { - destination="$1" - host=$(host "$1" | grep 'has address') - ip=$(echo "$host" | cut -d' ' -f4) - ping -c1 $ip > /dev/null 2>&1 - - if [ $? -eq 0 ]; then - echo "$1" is on the network - else - echo "$1" is NOT on the network - fi -} - -for i in "$@"; do - check "$i" -done -exit 0 |
