changeset 798:4a4ba4a2061d draft

updates to peer2anonet
author d3v11 <d3v11@d3v11.ano>
date Mon, 28 Nov 2011 19:49:16 +0000
parents 18040cd350e1
children f0b58a1a7afd
files contrib/peer2anonet/peer2anonet
diffstat 1 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/peer2anonet/peer2anonet	Mon Nov 28 08:56:10 2011 +0000
+++ b/contrib/peer2anonet/peer2anonet	Mon Nov 28 19:49:16 2011 +0000
@@ -401,15 +401,23 @@
     GIT_IP=`cat conf/gitd_ip`
     GIT_DOMAIN="git.$NICK.ano"
 
-    ip addr add $TINYDNS_ROOT_IP/32 dev lo &
-    ip addr add $TINYDNS_IP/32 dev lo &
-    ip addr add $TINYDNS_ANO_IP/32 dev lo &
-    ip addr add $GIT_IP/32 dev lo &
+    ip addr add $TINYDNS_ROOT_IP/32 dev lo > /dev/null 2>&1
+    ip addr add $TINYDNS_IP/32 dev lo > /dev/null 2>&1
+    ip addr add $TINYDNS_ANO_IP/32 dev lo > /dev/null 2>&1
+    ip addr add $GIT_IP/32 dev lo > /dev/null 2>&1
 
-    echo "ip addr add $TINYDNS_ROOT_IP/32 dev lo &" >> /etc/rc.local
-    echo "ip addr add $TINYDNS_IP/32 dev lo &" >> /etc/rc.local
-    echo "ip addr add $TINYDNS_ANO_IP/32 dev lo &" >> /etc/rc.local
-    echo "ip addr add $GIT_IP/32 dev lo &" >> /etc/rc.local
+    if [[ $(cat /etc/rc.local) != *"ip addr add $TINYDNS_ROOT_IP/32 dev lo &"* ]]; then
+        echo "ip addr add $TINYDNS_ROOT_IP/32 dev lo &" >> /etc/rc.local
+    fi
+    if [[ $(cat /etc/rc.local) != *"ip addr add $TINYDNS_IP/32 dev lo &"* ]]; then
+        echo "ip addr add $TINYDNS_IP/32 dev lo &" >> /etc/rc.local
+    fi
+    if [[ $(cat /etc/rc.local) != *"ip addr add $TINYDNS_ANO_IP/32 dev lo &"* ]]; then
+        echo "ip addr add $TINYDNS_ANO_IP/32 dev lo &" >> /etc/rc.local
+    fi
+    if [[ $(cat /etc/rc.local) != *"ip addr add $GIT_IP/32 dev lo &"* ]]; then
+        echo "ip addr add $GIT_IP/32 dev lo &" >> /etc/rc.local
+    fi
 
     useradd Gdnscache
     useradd Gdnslog