#!/bin/bash # Shut down stuff svcstop /service/tinydns || exit 1 svcstop /service/dnscache || exit 1 useradd -u 102 gdnslog -g nobody -s /bin/false useradd -u 103 gdnscache -g nobody -s /bin/false useradd -u 101 tinydns -g nobody -s /bin/false useradd -u 104 logacct -g nobody -s /bin/false #if [ ! -h /etc/dnscache ]; then # if [ -d /etc/dnscache ]; then # mv /etc/dnscache /home/system || exit 1 # ln -s /home/system/dnscache /etc # else # ln -s /home/system/dnscache /etc # fi #fi #if [ ! -h /etc/tinydns ]; then # if [ -d /etc/tinydns ]; then # mv /etc/tinydns /home/system || exit 1 # ln -s /home/system/tinydns /etc # else # ln -s /home/system/tinydns /etc # fi #fi if [ ! -d /etc/dnscache ]; then dnscache-conf gdnscache gdnslog /etc/dnscache 0.0.0.0 fi #add the tailorred start/stop scripts mv /var/dnscache/start /etc/dnscache mv /var/dnscache/stop /etc/dnscache if [ ! -d /etc/tinydns ]; then tinydns-conf tinydns logacct /etc/tinydns 127.0.0.2 fi if [ -d /etc/dnscache/root ]; then mv /etc/dnscache/root/* /home/system/dnscache/ rmdir /etc/dnscache/root fi if [ -d /etc/tinydns/root ]; then mv /etc/tinydns/root/* /home/system/tinydns/ rmdir /etc/tinydns/root fi touch /home/system/dnscache/ip/{127,10,192.168} for I in `seq 16 31`; do touch /home/system/dnscache/ip/172.$I done echo "/home/system/tinydns" > /etc/tinydns/env/ROOT echo "/home/system/dnscache" > /etc/dnscache/env/ROOT pushd /home/system/tinydns make || exit 1 popd ln -sf /etc/tinydns /service ln -sf /etc/dnscache /service #always update our root ns list with a fresh version cp /etc/dnsroots.global /home/system/dnscache/servers/@ #lelijke hack, nodig om een oude buggy package te updaten pkill -f "supervise tinydns" pkill -f "supervise dnscache" #reset services naar orignele staat svcreset /service/dnscache || exit 1 svcreset /service/tinydns || exit 1 exit 0