summaryrefslogtreecommitdiff
path: root/contrib/peer2anonet
diff options
context:
space:
mode:
authorNick <nick@somerandomnick.ano>2011-12-27 19:44:11 +0000
committerNick <nick@somerandomnick.ano>2011-12-27 19:44:11 +0000
commit499ae51b46a3a2f2f402d541afac09c102f39a16 (patch)
tree7aec3bcfdf6ef3b0d24f05a444764c40a14b9f82 /contrib/peer2anonet
parentf45333d6304eba1ffb0403489f3852b574cef729 (diff)
parent78145ff44783ee3c6deb80d3ea47e939deef0c7e (diff)
downloadresdb-499ae51b46a3a2f2f402d541afac09c102f39a16.tar.gz
resdb-499ae51b46a3a2f2f402d541afac09c102f39a16.zip
Merge commit '78145ff44783ee3c6deb80d3ea47e939deef0c7e'
Diffstat (limited to 'contrib/peer2anonet')
-rw-r--r--contrib/peer2anonet/README.html4
-rwxr-xr-xcontrib/peer2anonet/peer2anonet22
2 files changed, 17 insertions, 9 deletions
diff --git a/contrib/peer2anonet/README.html b/contrib/peer2anonet/README.html
index 6866354..52c732b 100644
--- a/contrib/peer2anonet/README.html
+++ b/contrib/peer2anonet/README.html
@@ -93,6 +93,10 @@
<b>CONFIGURATION FILES:</b>
+ If /etc/peer2anonet/bird.conf exists, then peer2anonet
+ will not create a new bird. Instead it will use this
+ bird.conf and append new protocols to it.
+
/etc/peer2anonet/peers/$PEER/* contains:
asn local_port peering_ip pubkey remote_ip remote_port run seckey
diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet
index 152f4a4..715f507 100755
--- a/contrib/peer2anonet/peer2anonet
+++ b/contrib/peer2anonet/peer2anonet
@@ -142,7 +142,10 @@ UPDATE(){
bird -c bird.conf -d' > /services/bird/run
chmod +x /services/bird/run
- echo "function n_AnoNet_mine (prefix arg) {
+ if [ -e /etc/peer2anonet/bird.conf ]; then
+ cp /etc/peer2anonet/bird.conf /services/bird/bird.conf
+ else
+ echo "function n_AnoNet_mine (prefix arg) {
if arg ~ [ $P2A_NET/24+ ] then return true;
return false; };
@@ -190,6 +193,7 @@ protocol direct direct_AnoNet_routes { table AnoNet_routes;
interface \"eth0\";
import filter only_AnoNet;
}" > /services/bird/bird.conf
+ fi
for PEER in `ls /etc/peer2anonet/peers`; do
mkdir -p /services/"$PEER"
@@ -409,14 +413,14 @@ CONFIGURE_DNS(){
)
echo -e '\nCONFIGURE DNS:\n'
- NICK=`cat conf/git_name`
- TINYDNS_ROOT_IP=`cat conf/tinydns__rootsrvrip`
- TINYDNS_ROOT_DOMAIN=`cat conf/tinydns__rootsrvrname`
- TINYDNS_ANO_IP=`cat conf/tinydns__tldsrvrip`
- TINYDNS_ANO_DOMAIN=`cat conf/tinydns__tldsrvrname`
- TINYDNS_IP=`cat conf/tinydns__srvrip`
- TINYDNS_DOMAIN=`cat conf/tinydns__srvrname`
- GIT_IP=`cat conf/gitd_ip`
+ NICK=`cat conf/git_name` || exit 1
+ TINYDNS_ROOT_IP=`cat conf/tinydns__rootsrvrip` || exit 1
+ TINYDNS_ROOT_DOMAIN=`cat conf/tinydns__rootsrvrname` || exit 1
+ TINYDNS_ANO_IP=`cat conf/tinydns__tldsrvrip` || exit 1
+ TINYDNS_ANO_DOMAIN=`cat conf/tinydns__tldsrvrname` || exit 1
+ TINYDNS_IP=`cat conf/tinydns__srvrip` || exit 1
+ TINYDNS_DOMAIN=`cat conf/tinydns__srvrname` || exit 1
+ GIT_IP=`cat conf/gitd_ip` || exit 1
GIT_DOMAIN="git.$NICK.ano"
ip addr add $TINYDNS_ROOT_IP/32 dev lo > /dev/null 2>&1