Remove building with NOCRYPTO option
[minix.git] / external / bsd / bind / dist / contrib / zkt-1.1.3 / examples / flat / dist.sh
blobc676ac6807ecafacf2924f9a910b92173c6ebdc4
1 #################################################################
3 # @(#) dist.sh -- distribute and reload command for dnssec-signer
5 # (c) Jul 2008 Holger Zuleger hznet.de
7 # Feb 2010 action "distkeys" added
9 # This shell script will be run by dnssec-signer as a distribution
10 # and reload command if:
12 # a) the dnssec.conf file parameter Distribute_Cmd: points
13 # to this file
14 # and
15 # b) the user running the dnssec-signer command is not
16 # root (uid==0)
17 # and
18 # c) the owner of this shell script is the same as the
19 # running user and the access rights don't allow writing
20 # for anyone except the owner
21 # or
22 # d) the group of this shell script is the same as the
23 # running user and the access rights don't allow writing
24 # for anyone except the group
26 #################################################################
28 # set path to rndc and scp
29 PATH="/bin:/usr/bin:/usr/local/sbin"
31 # remote server and directory
32 server=localhost # fqdn of remote name server
33 dir=/var/named # zone directory on remote name server
35 progname=$0
36 usage()
38 echo "usage: $progname distribute|reload <domain> <path_to_zonefile> [<viewname>]" 1>&2
39 test $# -gt 0 && echo $* 1>&2
40 exit 1
43 if test $# -lt 3
44 then
45 usage
47 action="$1"
48 domain="$2"
49 zonefile="$3"
50 view=""
51 test $# -gt 3 && view="$4"
53 case $action in
54 distkeys)
55 if test -n "$view"
56 then
57 echo "scp K$zone+* $server:$dir/$view/$zone/"
58 : scp K$zone+* $server:$dir/$view/$zone/
59 else
60 echo "scp K$zone+* $server:$dir/$zone/"
61 : scp K$zone+* $server:$dir/$zone/
64 distribute)
65 if test -n "$view"
66 then
67 echo "scp $zonefile $server:$dir/$view/$domain/"
68 : scp $zonefile $server:$dir/$view/$domain/
69 else
70 echo "scp $zonefile $server:$dir/$domain/"
71 : scp $zonefile $server:$dir/$domain/
74 reload)
75 echo "rndc $action $domain $view"
76 : rndc $action $domain $view
79 usage "illegal action $action"
81 esac