diff options
author | root <root@monitoring.shack> | 2012-09-13 23:39:58 +0000 |
---|---|---|
committer | root <root@monitoring.shack> | 2012-09-13 23:39:58 +0000 |
commit | db849a18e1659ff28433384d2cdca2989a6d5df0 (patch) | |
tree | d600fb3f3e5f0a54b6254c85ee8a3b836ef3d90d /retiolum/openwrt | |
parent | d5d39fc3d56b021b642ee6e1d5625524ebbc4d99 (diff) | |
parent | 88d4bdc29eb9ce5f62099f2be1488ae927aa09d5 (diff) |
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'retiolum/openwrt')
-rwxr-xr-x | retiolum/openwrt/tinc-up | 19 | ||||
-rwxr-xr-x | retiolum/openwrt/updater | 6 |
2 files changed, 25 insertions, 0 deletions
diff --git a/retiolum/openwrt/tinc-up b/retiolum/openwrt/tinc-up new file mode 100755 index 00000000..3b8bb978 --- /dev/null +++ b/retiolum/openwrt/tinc-up @@ -0,0 +1,19 @@ +# source: krebscode/painload/retiolum/scripts/tinc_setup/tinc-up + +dirname="`dirname "$0"`" + +conf=$dirname/tinc.conf + +name=`sed -n 's|^ *Name *= *\([^ ]*\) *$|\1|p' $conf` + +host=$dirname/hosts/$name + +addr4=`sed -n 's|^ *Subnet *= *\(10[.][^ ]*\) *$|\1|p' $host` +if [ "$addr4" != '' ];then + ifconfig $INTERFACE $addr4 + route add -net 10.243.0.0 netmask 255.255.0.0 dev retiolum +else + addr4=`sed -n 's|^ *Subnet *= *\(42[.][^ ]*\) *$|\1|p' $host` + ifconfig $INTERFACE $addr4 + route add -net 42.0.0.0 netmask 255.0.0.0 dev retiolum +fi diff --git a/retiolum/openwrt/updater b/retiolum/openwrt/updater new file mode 100755 index 00000000..4dbc7d78 --- /dev/null +++ b/retiolum/openwrt/updater @@ -0,0 +1,6 @@ +#!/bin/sh +cd /etc/tinc/retiolum/hosts +wget http://vpn.miefda.org/hosts.tar.gz +tar xzf hosts.tar.gz +rm hosts.tar.gz +tincd -n retiolum -kHUP |