diff options
author | d3v11 <d3v11@d3v11.ano> | 2011-11-26 23:47:46 +0000 |
---|---|---|
committer | d3v11 <d3v11@d3v11.ano> | 2011-11-26 23:47:46 +0000 |
commit | 9002a3eb108b7bb58797527875e25eb1c906d9c8 (patch) | |
tree | 8126b0ba6ce0279047920fe7819ffb9a18994169 /contrib/peer2anonet | |
parent | 527a2e2ab7fa215d151e2ad2dd3d05d0729e3e9f (diff) | |
download | resdb-9002a3eb108b7bb58797527875e25eb1c906d9c8.tar.gz resdb-9002a3eb108b7bb58797527875e25eb1c906d9c8.zip |
updates for peer2anonet
Diffstat (limited to 'contrib/peer2anonet')
-rw-r--r-- | contrib/peer2anonet/README | 7 | ||||
-rwxr-xr-x | contrib/peer2anonet/peer2anonet | 40 |
2 files changed, 38 insertions, 9 deletions
diff --git a/contrib/peer2anonet/README b/contrib/peer2anonet/README index 1b300b4..1693e7c 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 e704913..6f5bbb2 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 |