Last change
on this file since 13913 was 13913, checked in by rick, 7 years ago |
Suspend errors in cron, else they end op in mailbox
|
-
Property svn:executable
set to
*
|
File size:
675 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
|
---|
Note:
See
TracBrowser
for help on using the repository browser.