Last change
on this file since 14249 was 14249, checked in by rick, 6 years ago |
Fix useless cron output generated from nsd-control
Fixes beheer#241
|
-
Property svn:executable
set to
*
|
File size:
686 bytes
|
Line | |
---|
1 | #!/bin/sh
|
---|
2 | #
|
---|
3 | # Rick van der Zwet <info@rickvanderzwet.nl>
|
---|
4 | #
|
---|
5 | # Update local autoritive DNS server, by transfering zone files from master
|
---|
6 | # using HTTP protocol
|
---|
7 | #
|
---|
8 |
|
---|
9 | # Avoid hammering source, sleep random delay
|
---|
10 | if [ "$1" = "cron" ]; then
|
---|
11 | sleep $(jot -r 1 900)
|
---|
12 | exec 2>/dev/null
|
---|
13 | fi
|
---|
14 |
|
---|
15 | # Fetch source files
|
---|
16 | fetch -T 5 -o /tmp/dns.tar.gz.enc http://wirelessleiden.nl/dns/latest.tar.gz.enc || exit 1
|
---|
17 |
|
---|
18 | # Check if file has transfered succesfully
|
---|
19 | openssl enc -bf -pass pass:dns -in /tmp/dns.tar.gz.enc -out /dev/null -d 2>/dev/null || exit 1
|
---|
20 |
|
---|
21 | # Unpack files
|
---|
22 | openssl enc -bf -pass pass:dns -in /tmp/dns.tar.gz.enc -d | tar -C /tmp -xzvf -
|
---|
23 |
|
---|
24 | # Reload autoritive DNS Server
|
---|
25 | nsd-control reload >/dev/null
|
---|
Note:
See
TracBrowser
for help on using the repository browser.