changeset 1041:7d7befd08968 draft

[peer2anonet] ip addr add (thanks talamon)
author d3v11 <d3v11@d3v11.ano>
date Mon, 29 Oct 2012 04:39:39 +0000
parents e267926631b6
children b211722679fb
files contrib/peer2anonet/peer2anonet
diffstat 1 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/peer2anonet/peer2anonet	Thu Oct 18 11:19:33 2012 +0000
+++ b/contrib/peer2anonet/peer2anonet	Mon Oct 29 04:39:39 2012 +0000
@@ -559,7 +559,7 @@
 
     (
         cd /service
-        svc -d dnscache tinydns tinydns-ano tinydns-root
+        svc -d dnscache tinydns tinydns-ano tinydns-root >/dev/null 2>&1
         rm -f dnscache tinydns tinydns-ano tinydns-root
         cd /services
         rm -rf dnscache tinydns tinydns-ano tinydns-root
@@ -605,8 +605,17 @@
         echo "ip addr add $GIT_IP/32 dev lo &" >> /etc/rc.d/rc.local
         fi
     else
-        echo "   fatal error: cannot reliably assign ip's to startup"
-        exit 1
+        (
+          mkdir -p /services/tinydns-ips
+          echo "#!/bin/sh -e" > /services/tinydns-ips/run
+          echo "ip addr add $TINYDNS_ROOT_IP/32 dev lo &" >> /services/tinydns-ips/run
+          echo "ip addr add $TINYDNS_IP/32 dev lo &" >> /services/tinydns-ips/run
+          echo "ip addr add $TINYDNS_ANO_IP/32 dev lo &" >> /services/tinydns-ips/run
+          echo "ip addr add $GIT_IP/32 dev lo &" >> /services/tinydns-ips/run
+          echo "svc -d ." /services/tinydns-ips/run
+          chmod +x /services/tinydns-ips/run
+          test -L /service/tinydns-ips || ln -s /services/tinydns-ips /service/tinydns-ips
+        )
     fi
 
     ip addr add $TINYDNS_ROOT_IP/32 dev lo > /dev/null 2>&1