repo: resdb
action: commit
revision: 
path_from: 
revision_from: 9002a3eb108b7bb58797527875e25eb1c906d9c8:
path_to: 
revision_to: 
git.thebackupbox.net
resdb
git clone git://git.thebackupbox.net/resdb
commit 9002a3eb108b7bb58797527875e25eb1c906d9c8
Author: d3v11 
Date:   Sat Nov 26 23:47:46 2011 +0000

    updates for peer2anonet

diff --git a/contrib/peer2anonet/README b/contrib/peer2anonet/README
index 1b300b4b73c85dbaad46ab794b06d8b473cb0977..
index ..1693e7c8e7e4a2e9761d5dac5aff6c636959ae69 100644
--- a/contrib/peer2anonet/README
+++ b/contrib/peer2anonet/README
@@ -101,6 +101,13 @@ RTFM:

         ./contrib/peer2anonet/peer2anonet --configure-dns

+    COMPLAIN:
+
+        If this README doesn't tell you what you need to know
+        you can head over to www.d3v11.ano/peering. If that
+        doesn't get you what you want then either complain to
+        me or shoot both of us in the face.
+



diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet
index e7049139b08585c75d10e3409922d7a8f4dfd6c6..
index ..6f5bbb2f0020a8adcf6c5fabcae75ee1d316ba82 100755
--- a/contrib/peer2anonet/peer2anonet
+++ b/contrib/peer2anonet/peer2anonet
@@ -36,19 +36,28 @@ CONFIGURE(){
     read -p "   Enter your AnoNet router: " P2A_ROUTE
     read -p "   Enter your peering ip: " P2A_IP
     read -p "   Enter your AnoNet asn: " P2A_ASN
+
+
     echo "P2A_NET=\"$P2A_NET\"">/etc/peer2anonet/p2a.conf
     echo "P2A_ROUTE=\"$P2A_ROUTE\"">>/etc/peer2anonet/p2a.conf
     echo "P2A_IP=\"$P2A_IP\"">>/etc/peer2anonet/p2a.conf
     echo "P2A_ASN=\"$P2A_ASN\"">>/etc/peer2anonet/p2a.conf
     echo -e '\npeer2anonet: configured\n'
+
     NICK=`cat conf/git_name`
     ./scripts/add_as $P2A_ASN $NICK
     ./scripts/add_ip $P2A_NET/24 $NICK
-    ./scripts/add_dom $NICK.ano $NICK a.ns.$NICK.ano/`cat db/dom/ano/$NICK/ns/a.ns.$NICK.ano`
     exit 0
     }

 UPDATE(){
+    if [ -e /etc/peer2anonet/p2a.conf ]; then
+        source /etc/peer2anonet/p2a.conf
+    else
+        CONFIGURE
+        exit 0
+    fi
+
     echo -e '\nUPDATE:\n'
     if [[ $(ls /etc/peer2anonet/peers) ]]; then
         for PEER in `ls /etc/peer2anonet/peers`; do
@@ -233,13 +242,19 @@ exec /usr/sbin/quicktun.nacltai" > /etc/peer2anonet/peers/$PEER/run
         fi
         chmod +x /services/"$PEER"/run
         test -L "/service/$PEER" || ln -s "/services/$PEER" "/service/$PEER"
-        svc -d "/service/$PEER" && svc -u "/service/$PEER"
     done
     test -L /service/bird || ln -s /services/bird /service/bird
     echo configure | birdc
     }

 CONFIGURE_PEER(){
+    if [ -e /etc/peer2anonet/p2a.conf ]; then
+        source /etc/peer2anonet/p2a.conf
+    else
+        CONFIGURE
+        exit 0
+    fi
+
     echo -e '\nCONFIGURE PEER:\n'
     read -p "   Enter your peer's name: " PEER
     read -p "   Enter your peer's remote ip: " REMOTEIP
@@ -260,6 +275,13 @@ CONFIGURE_PEER(){
     }

 RM_PEER(){
+    if [ -e /etc/peer2anonet/p2a.conf ]; then
+        source /etc/peer2anonet/p2a.conf
+    else
+        CONFIGURE
+        exit 0
+    fi
+
     echo -e '\nRM PEER:\n'
     read -p "   Enter your peer's name: " PEER
     if [ -e /etc/peer2anonet/peers/"$PEER" ]; then
@@ -329,6 +351,13 @@ INSTALL_DJBDNS(){
     }

 CONFIGURE_DNS(){
+    if [ -e /etc/peer2anonet/p2a.conf ]; then
+        source /etc/peer2anonet/p2a.conf
+    else
+        CONFIGURE
+        exit 0
+    fi
+
     echo -e '\nCONFIGURE DNS:\n'
     NICK=`cat conf/git_name`
     TINYDNS_ROOT_IP=`cat conf/tinydns__rootsrvrip`
@@ -390,13 +419,6 @@ CONFIGURE_DNS(){
     ( cd /service ; svc -t dnscache tinydns* )    
     }

-if [ -e /etc/peer2anonet/p2a.conf ]; then
-    source /etc/peer2anonet/p2a.conf
-else
-    CONFIGURE
-    exit 0
-fi
-

 if [ "$1" == '--configure' ]; then
     CONFIGURE

-----END OF PAGE-----