From b56137d875f43026aeabcc4403252e5e7008b93a Mon Sep 17 00:00:00 2001 From: EUcancER Date: Tue, 23 Aug 2011 23:51:24 +0000 Subject: check-free-retiolum: fixed bug which produces wrong match --- retiolum/bin/check-free-retiolum-v4 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'retiolum/bin') 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 -- cgit v1.2.3 From 229b805732cc34c30bb287aa750fbd14df94cc81 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 6 Sep 2011 23:00:03 +0200 Subject: //retiolum update-retiolum-hosts: cd //retiolum first This commit enables to call the script from everywhere...^_^ --- retiolum/bin/update-retiolum-hosts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'retiolum/bin') diff --git a/retiolum/bin/update-retiolum-hosts b/retiolum/bin/update-retiolum-hosts index 7b2fa0e5..1fecfe15 100755 --- a/retiolum/bin/update-retiolum-hosts +++ b/retiolum/bin/update-retiolum-hosts @@ -7,6 +7,9 @@ if test "${nosudo-false}" != true -a `id -u` != 0; then exit 23 # go to hell fi +# cd //retiolum +cd $(dirname $(readlink -f $0))/.. + mkdir -v -p /etc/tinc/retiolum/hosts cp -v -r hosts/* /etc/tinc/retiolum/hosts pkill -HUP tincd -- cgit v1.2.3