From 2d12af923db0e2ed936c23c4e3c977fd5ee73ee4 Mon Sep 17 00:00:00 2001 From: d3v11 Date: Sun, 15 Jan 2012 22:09:32 +0000 Subject: slackware support for ./contrib/peer2anonet/peer2anonet --configure-dns --- contrib/peer2anonet/peer2anonet | 44 +++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 13 deletions(-) (limited to 'contrib/peer2anonet') 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 -- cgit v1.2.3