summaryrefslogtreecommitdiffstats
path: root/retiolum
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2014-04-25 12:02:12 +0200
committermakefu <github@syntax-fehler.de>2014-04-25 12:02:12 +0200
commit9afc6e2d0237ae84c084cc05492bf0f285f98851 (patch)
treefcf6627e59387cbb5c3a19f10caa366dec39842a /retiolum
parent9bdee602a30f715c9ba2583d3948c360448c670b (diff)
parent771b8cb9526255d54c8069b49503b427058a84b0 (diff)
Merge branch 'master' of ssh://github.com/krebscode/painload
Diffstat (limited to 'retiolum')
-rw-r--r--[-rwxr-xr-x]retiolum/Makefile0
-rwxr-xr-xretiolum/bin/hosts4
-rwxr-xr-xretiolum/bin/update-retiolum-hosts2
-rwxr-xr-xretiolum/bin/update_tinc_hosts7
-rwxr-xr-xretiolum/scripts/tinc_setup/new_install.sh9
5 files changed, 12 insertions, 10 deletions
diff --git a/retiolum/Makefile b/retiolum/Makefile
index 54683469..54683469 100755..100644
--- a/retiolum/Makefile
+++ b/retiolum/Makefile
diff --git a/retiolum/bin/hosts b/retiolum/bin/hosts
index 4856d494..44dbd88d 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 '$i'.'$netname' '$i'|p
' $i
done | sort
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/
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}"
diff --git a/retiolum/scripts/tinc_setup/new_install.sh b/retiolum/scripts/tinc_setup/new_install.sh
index b48649ec..1f45a3cc 100755
--- a/retiolum/scripts/tinc_setup/new_install.sh
+++ b/retiolum/scripts/tinc_setup/new_install.sh
@@ -43,6 +43,11 @@ main(){
RAND4=1
RAND6=1
+ if $(echo $HOSN | grep -q -); then
+ echo 'invalid hostname, - not allowed'
+ exit 1
+ fi
+
if [ $IP4 -eq 0 ]; then
RAND4=1
@@ -196,9 +201,9 @@ LocalDiscovery = yes
AutoConnect = 3
#ConnectTos
-ConnectTo = slowpoke
+ConnectTo = fastpoke
ConnectTo = pigstarter
-ConnectTo = pico
+ConnectTo = kheurop
EOF
host2subnet $MASK4