summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEUcancER <root@euer.krebsco.de>2011-08-23 23:51:24 +0000
committerEUcancER <root@euer.krebsco.de>2011-08-23 23:52:23 +0000
commitb56137d875f43026aeabcc4403252e5e7008b93a (patch)
treebb73ab3547f8c6861adbe8dc8952cb48bec70805
parentf5d75883e517965fa025e7b88e790a13a3e9dc9b (diff)
check-free-retiolum: fixed bug which produces wrong match
-rwxr-xr-xretiolum/bin/check-free-retiolum-v45
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