From 5b8629ac299d4578fc163dc90b9ec9ec965ba32b Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 20 Apr 2014 22:09:20 +0200 Subject: update_tinc_host: kill readlink --- retiolum/bin/update_tinc_hosts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'retiolum/bin') diff --git a/retiolum/bin/update_tinc_hosts b/retiolum/bin/update_tinc_hosts index ce1be497..46076cf2 100755 --- a/retiolum/bin/update_tinc_hosts +++ b/retiolum/bin/update_tinc_hosts @@ -7,11 +7,8 @@ if test "${nosudo-false}" != true -a `id -u` != 0; then exit 23 # go to hell fi -list_hosts="$( - basename="`readlink -f "$0"`" - bindir="`dirname "$basename"`" - echo "$bindir/hosts" -)" +list_hosts=$(cd -P "$(dirname "$0")" && pwd -P)/hosts + hosts() { "$list_hosts"; } hosts="${hosts-/etc/hosts}" -- cgit v1.2.3 From 59c99ac37ce28d3684cf5b61180c588ff8408762 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 20 Apr 2014 22:18:28 +0200 Subject: update-retiolum-hosts: remove readlink --- retiolum/bin/update-retiolum-hosts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'retiolum/bin') diff --git a/retiolum/bin/update-retiolum-hosts b/retiolum/bin/update-retiolum-hosts index eb57af3f..0eae1c29 100755 --- a/retiolum/bin/update-retiolum-hosts +++ b/retiolum/bin/update-retiolum-hosts @@ -8,7 +8,7 @@ if test "${nosudo-false}" != true -a `id -u` != 0; then fi # cd //retiolum -cd $(dirname $(readlink -f $0))/.. +cd -P "$(dirname "$0")/.." mkdir -p /etc/tinc/retiolum/hosts rsync -va -I --delete hosts/ /etc/tinc/retiolum/hosts/ -- cgit v1.2.3 From 74ac7de3f0ada98d591f4b67e21ec0eeedb638fa Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 20 Apr 2014 22:51:35 +0200 Subject: retiolum/bin/hosts: \? is not BRE --- retiolum/bin/hosts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'retiolum/bin') diff --git a/retiolum/bin/hosts b/retiolum/bin/hosts index 4856d494..4426a811 100755 --- a/retiolum/bin/hosts +++ b/retiolum/bin/hosts @@ -6,8 +6,8 @@ netname=${1-retiolum} cd /etc/tinc/$netname/hosts for i in `ls`; do - sed -n ' - s|^ *Subnet *= *\([^ /]*\)\(/[0-9]*\)\? *$|\1\t'$i'.'$netname' '$i'|p + sed -En ' + s|^ *Subnet *= *([^ /]*)(/[0-9]*)? *$|\1\t'$i'.'$netname' '$i'|p ' $i done | sort -- cgit v1.2.3 From dd5d0af9e64e343e68d5b3fc766767f5ebfa9a89 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 20 Apr 2014 22:54:02 +0200 Subject: retiolum/bin/hosts: osx doesn't know \t --- retiolum/bin/hosts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'retiolum/bin') diff --git a/retiolum/bin/hosts b/retiolum/bin/hosts index 4426a811..44dbd88d 100755 --- a/retiolum/bin/hosts +++ b/retiolum/bin/hosts @@ -7,7 +7,7 @@ cd /etc/tinc/$netname/hosts for i in `ls`; do sed -En ' - s|^ *Subnet *= *([^ /]*)(/[0-9]*)? *$|\1\t'$i'.'$netname' '$i'|p + s|^ *Subnet *= *([^ /]*)(/[0-9]*)? *$|\1 '$i'.'$netname' '$i'|p ' $i done | sort -- cgit v1.2.3