diff options
author | tv <tv@xso> | 2011-08-31 23:50:23 +0200 |
---|---|---|
committer | tv <tv@xso> | 2011-08-31 23:50:23 +0200 |
commit | 2c112849f29620db6824bc9ad2762e52d857d079 (patch) | |
tree | ba793c2fab1b7cfc45cb8413ab9bbf2175617cb9 /retiolum/bin/check-free-retiolum-v4 | |
parent | 40474badc13adff28f34424b860500c45871f781 (diff) | |
parent | d88d17941f4b2f249747fd90ac5c40349d8f2392 (diff) |
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'retiolum/bin/check-free-retiolum-v4')
-rwxr-xr-x | retiolum/bin/check-free-retiolum-v4 | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/retiolum/bin/check-free-retiolum-v4 b/retiolum/bin/check-free-retiolum-v4 index e9c6b3ce..3f0dbdf8 100755 --- a/retiolum/bin/check-free-retiolum-v4 +++ b/retiolum/bin/check-free-retiolum-v4 @@ -1,5 +1,4 @@ #! /bin/sh -set -x netname=retiolum myipv4=${1-10.7.7.-1} v4num=${myipv4##*.} @@ -10,12 +9,12 @@ then cd /etc/tinc/$netname/hosts printf "Check if ip is still free: " for i in `ls -1`; do - if grep $myipv4 $i &>/dev/null ;then + if grep -q -e $myipv4\$ $i ;then echo "Host IP already taken by $i! " exit 1 fi done - printf "Passed" + printf "Passed\n" else printf "you are made of stupid. bailing out\n" exit 1 |