summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcontrib/peer2anonet/peer2anonet44
1 files changed, 31 insertions, 13 deletions
diff --git a/contrib/peer2anonet/peer2anonet b/contrib/peer2anonet/peer2anonet
index b087aa3..d699287 100755
--- a/contrib/peer2anonet/peer2anonet
+++ b/contrib/peer2anonet/peer2anonet
@@ -435,24 +435,42 @@ CONFIGURE_DNS(){
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