diff options
author | Momo <momorientes@online.de> | 2011-09-01 12:17:21 +0200 |
---|---|---|
committer | Momo <momorientes@online.de> | 2011-09-01 12:17:21 +0200 |
commit | ff0030cd7fe92a09173c16bf7b483cde638dab46 (patch) | |
tree | 33c1cd58756ea023eb304a1504b3a079a7eae63a /retiolum/bin/check-free-retiolum-v4 | |
parent | 77d4efad2e89fe9357b10b1bd173fbded82468fe (diff) | |
parent | abf8674a3fc02f172768be911c6e719290bf6bd5 (diff) |
Merge branch 'master' of https://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 |