Autonomer DNService

#!/bin/sh
# Time-stamp: <>

# Quick and dirty dnscache setup for people which don't really care.
# it downloads and installs djbdns and daemontools and sets up
# dnscache to run under supervise on 127.0.0.1. Hacked by
# drt@un.bewaff.net.

# Location of your local startup-script. You probably have to change
# this.

# BSD
RCLOCAL=/etc/rc.local

# RedHat
#RCLOCAL=/etc/rc.d/rc.local

# UID to runn the server
SVRUID=daemon
LOGUID=daemon

cd /tmp
wget http://cr.yp.to/djbdns/djbdns-1.02.tar.gz
tar xzvf djbdns-1.02.tar.gz
cd djbdns-1.02
make setup
cd ..
wget http://cr.yp.to/daemontools/daemontools-0.70.tar.gz
tar xzvf daemontools-0.70.tar.gz
cd daemontools-0.70 
make setup 
rm -Rf daemontools-0.70* djbdns-1.02*
mkdir /var/service
/usr/local/bin/dnscache-conf $LOGUID $SVRUID /var/service/dnscache
mkdir /service
chmod 755 /service
echo "2>&1 env - PATH=/usr/local/bin:/usr/sbin:/usr/bin:/bin csh -cf 'svscan /service &'" >> $RCLOCAL
ln -sv /var/service/dnscache /service
echo  "nameserver 127.0.0.1" > /tmp/r.c
cat /etc/resolv.conf >> tmp/r.c
mv /tmp/r.c /etc/resolv.conf

Doobee R. Tzeck
Last modified: Tue Oct 10 17:11:04 CEST 2000