diff options
| author | mo khan <mo@mokhan.ca> | 2019-09-07 13:37:06 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2019-09-07 13:37:06 -0600 |
| commit | 07454039c7ed4384a679325e9cd75c1faaceb43d (patch) | |
| tree | df98d7801cd164303db2e69f9f791eea29d85f73 /bin/problem-7.sh | |
| parent | 6be22260797400ace8fa1ff36275c49ede9d4f25 (diff) | |
dump old assignment
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 |
