source: npl/internetserver/djbdns/post.djbdns @ 9c8fcb1

gcc484perl-5.22
Last change on this file since 9c8fcb1 was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 1.9 KB
Line 
1#!/bin/bash
2
3# Shut down stuff
4svcstop /service/tinydns || exit 1
5svcstop /service/dnscache || exit 1
6
7useradd -u 102 gdnslog -g nobody -s /bin/false
8useradd -u 103 gdnscache -g nobody -s /bin/false
9useradd -u 101 tinydns -g nobody -s /bin/false
10useradd -u 104 logacct -g nobody -s /bin/false
11
12#if [ ! -h /etc/dnscache ]; then
13#    if [ -d /etc/dnscache ]; then
14#       mv /etc/dnscache /home/system || exit 1
15#       ln -s /home/system/dnscache /etc
16#    else
17#       ln -s /home/system/dnscache /etc
18#    fi
19#fi
20
21#if [ ! -h /etc/tinydns ]; then
22#    if [ -d /etc/tinydns ]; then
23#        mv /etc/tinydns /home/system || exit 1
24#       ln -s /home/system/tinydns /etc
25#    else
26#       ln -s /home/system/tinydns /etc
27#    fi
28#fi
29
30if [ ! -d /etc/dnscache ]; then
31    dnscache-conf gdnscache gdnslog /etc/dnscache 0.0.0.0
32fi
33
34#add the tailorred start/stop scripts
35mv /var/dnscache/start /etc/dnscache
36mv /var/dnscache/stop /etc/dnscache
37
38
39if [ ! -d /etc/tinydns ]; then
40    tinydns-conf tinydns logacct /etc/tinydns 127.0.0.2
41fi
42
43if [ -d /etc/dnscache/root ]; then
44    mv /etc/dnscache/root/* /home/system/dnscache/
45    rmdir /etc/dnscache/root
46fi
47
48if [ -d /etc/tinydns/root ]; then
49    mv /etc/tinydns/root/* /home/system/tinydns/
50    rmdir /etc/tinydns/root
51fi
52
53touch /home/system/dnscache/ip/{127,10,192.168}
54for I in `seq 16 31`; do
55    touch /home/system/dnscache/ip/172.$I
56done
57
58echo "/home/system/tinydns" > /etc/tinydns/env/ROOT
59echo "/home/system/dnscache" > /etc/dnscache/env/ROOT
60
61pushd /home/system/tinydns
62make || exit 1
63popd
64
65ln -sf /etc/tinydns /service
66ln -sf /etc/dnscache /service
67
68#always update our root ns list with a fresh version
69cp /etc/dnsroots.global /home/system/dnscache/servers/@
70
71#lelijke hack, nodig om een oude buggy package te updaten
72pkill -f "supervise tinydns"
73pkill -f "supervise dnscache"
74
75#reset services naar orignele staat
76svcreset /service/dnscache || exit 1
77svcreset /service/tinydns || exit 1
78
79exit 0
Note: See TracBrowser for help on using the repository browser.