Changeset 8101
- Timestamp:
- May 30, 2010, 4:31:58 PM (14 years ago)
- Location:
- 2.0/nanobsd/nanobsd/files/usr/local
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
2.0/nanobsd/nanobsd/files/usr/local/etc/mararc
r8025 r8101 11 11 12 12 csv2["wleiden.net."] = "db.wleiden.net" 13 csv2["16.172.in-addr.arpa."] = "db.16.172.in-addr.arpa." 14 csv2["17.172.in-addr.arpa."] = "db.17.172.in-addr.arpa." 15 csv2["18.172.in-addr.arpa."] = "db.18.172.in-addr.arpa." 16 csv2["19.172.in-addr.arpa."] = "db.19.172.in-addr.arpa." 17 csv2["20.172.in-addr.arpa."] = "db.20.172.in-addr.arpa." 18 csv2["21.172.in-addr.arpa."] = "db.21.172.in-addr.arpa." 19 csv2["22.172.in-addr.arpa."] = "db.22.172.in-addr.arpa." 20 csv2["23.172.in-addr.arpa."] = "db.23.172.in-addr.arpa." 21 csv2["24.172.in-addr.arpa."] = "db.24.172.in-addr.arpa." 22 csv2["25.172.in-addr.arpa."] = "db.25.172.in-addr.arpa." 23 csv2["26.172.in-addr.arpa."] = "db.26.172.in-addr.arpa." 24 csv2["27.172.in-addr.arpa."] = "db.27.172.in-addr.arpa." 25 csv2["28.172.in-addr.arpa."] = "db.28.172.in-addr.arpa." 26 csv2["29.172.in-addr.arpa."] = "db.29.172.in-addr.arpa." 27 csv2["30.172.in-addr.arpa."] = "db.30.172.in-addr.arpa." 28 csv2["31.172.in-addr.arpa."] = "db.31.172.in-addr.arpa." 13 29 14 30 # The address this DNS server runs on. If you want to bind -
2.0/nanobsd/nanobsd/files/usr/local/sbin/fetchzone.sh
r7625 r8101 2 2 3 3 # Set some vars 4 ZONE=wleiden.net 4 ZONES="wleiden.net 16.172.in-addr.arpa. 17.172.in-addr.arpa. 5 18.172.in-addr.arpa. 19.172.in-addr.arpa. 20.172.in-addr.arpa. 6 21.172.in-addr.arpa. 22.172.in-addr.arpa. 23.172.in-addr.arpa. 7 24.172.in-addr.arpa. 25.172.in-addr.arpa. 26.172.in-addr.arpa. 8 27.172.in-addr.arpa. 28.172.in-addr.arpa. 29.172.in-addr.arpa. 9 30.172.in-addr.arpa. 31.172.in-addr.arpa." 10 5 11 SERVER=195.169.86.131 6 12 APP=/usr/local/bin/fetchzone 7 TMPFILE=/tmp/dns-${ZONE}.tmp8 REALFILE=/usr/local/etc/maradns/db.${ZONE}9 13 LOGFILE=/var/log/fetchzone.log 10 14 PIDFILE=/var/run/fetchzone.pid … … 20 24 echo ${PID} > ${PIDFILE} 21 25 22 # No zone file to compare with, so lets make a dummy23 touch ${REALFILE}24 25 26 # Tell logfile that I am starting 26 27 log "[INFO] Fetchzone starting with PID: $PID" … … 29 30 while [ true ]; do 30 31 31 # Execute Fetchzone 32 ${APP} ${ZONE} ${SERVER} > ${TMPFILE} 32 # Run through multiple zones 33 for ZONE in ${ZONES} 34 do 33 35 34 # Did Fetchzone exit unhappy 35 if [ $? -eq 0 ]; then 36 # (re) Set some extra vars 37 TMPFILE=/tmp/dns-${ZONE}.tmp 38 REALFILE=/usr/local/etc/maradns/db.${ZONE} 39 # Execute Fetchzone 40 ${APP} ${ZONE} ${SERVER} > ${TMPFILE} 41 42 # Did Fetchzone exit unhappy 43 if [ $? -eq 0 ]; then 44 45 # Are there any changes? 46 COMM=`comm -23 ${TMPFILE} ${REALFILE} 2>&1` 47 if [ -n "$COMM" ]; then 48 49 # If there are any changes copy tmp to realfile 50 log "[INFO] Changes found" 51 cp ${TMPFILE} ${REALFILE} 52 53 # Maradns requires a restart to load new zonefile 54 /usr/local/etc/rc.d/maradns restart 55 56 fi 57 else 58 59 # Something went wrong lets log it 60 log "[ERROR] Errors found in fetchzone query" 61 fi 36 62 37 # Are there any changes? 38 COMM=`comm -23 ${TMPFILE} ${REALFILE}` 39 if [ -n "$COMM" ]; then 40 41 # If there are any changes copy tmp to realfile 42 log "[INFO] Changes found" 43 cp ${TMPFILE} ${REALFILE} 44 45 # Maradns requires a restart to load new zonefile 46 /usr/local/etc/rc.d/maradns restart 47 48 fi 49 else 50 51 # Something went wrong lets log it 52 log "[ERROR] Errors found in fetchzone query" 53 fi 63 done 54 64 55 65 # Lets go to sleep 56 66 sleep ${IDLE} 57 67 done 68
Note:
See TracChangeset
for help on using the changeset viewer.