Remove building with NOCRYPTO option
[minix.git] / external / bsd / bind / dist / contrib / zkt-1.1.3 / distribute.sh
blobd9e958952cfdb3e1afdb3873b9c3b9fac13964dd
1 #################################################################
3 # @(#) distribute.sh -- distribute and reload command for dnssec-signer
5 # (c) Jul 2008 Holger Zuleger hznet.de
7 # Feb 2010 action "distkeys" added but currently not used
9 # This shell script will be run by zkt-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 zkt-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 distkeys|distribute|reload <zone> <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 zone="$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/$zone/"
68 scp $zonefile $server:$dir/$view/$zone/
69 else
70 : echo "scp $zonefile $server:$dir/$zone/"
71 scp $zonefile $server:$dir/$zone/
74 reload)
75 : echo "rndc $action $zone $view"
76 rndc $action $zone $view
79 usage "illegal action $action"
81 esac