changeset 883:f4f941654717 draft

slackware support for ./contrib/peer2anonet/peer2anonet --configure-dns
author d3v11 <d3v11@d3v11.ano>
date Sun, 15 Jan 2012 22:09:32 +0000
parents e26b88d9df75
children cd9d07046b1c
files contrib/peer2anonet/peer2anonet
diffstat 1 files changed, 31 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/peer2anonet/peer2anonet	Sun Jan 15 08:21:58 2012 +0000
+++ b/contrib/peer2anonet/peer2anonet	Sun Jan 15 22:09:32 2012 +0000
@@ -435,24 +435,42 @@
     GIT_IP=`cat conf/gitd_ip` || exit 1
     GIT_DOMAIN="git.$NICK.ano"
 
+    if [ -w /etc/rc.local ]; then
+        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
+    elif [ -w /etc/rc.d/rc.local ]; then
+        if [[ $(cat /etc/rc.d/rc.local) != *"ip addr add $TINYDNS_ROOT_IP/32 dev lo &"* ]]; then
+            echo "ip addr add $TINYDNS_ROOT_IP/32 dev lo &" >> /etc/rc.d/rc.local
+        fi
+        if [[ $(cat /etc/rc.d/rc.local) != *"ip addr add $TINYDNS_IP/32 dev lo &"* ]]; then
+            echo "ip addr add $TINYDNS_IP/32 dev lo &" >> /etc/rc.d/rc.local
+        fi
+        if [[ $(cat /etc/rc.d/rc.local) != *"ip addr add $TINYDNS_ANO_IP/32 dev lo &"* ]]; then
+            echo "ip addr add $TINYDNS_ANO_IP/32 dev lo &" >> /etc/rc.d/rc.local
+        fi
+        if [[ $(cat /etc/rc.d/rc.local) != *"ip addr add $GIT_IP/32 dev lo &"* ]]; then
+        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
+    fi
+
     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
 
-    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
     useradd Gtinydns