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
15 # b) the user running the zkt-signer command is not
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
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
38 echo "usage: $progname distkeys|distribute|reload <zone> <path_to_zonefile> [<viewname>]" 1>&2
39 test $# -gt 0 && echo $
* 1>&2
51 test $# -gt 3 && view
="$4"
57 : echo "scp K$zone+* $server:$dir/$view/$zone/"
58 scp K
$zone+* $server:$dir/$view/$zone/
60 : echo "scp K$zone+* $server:$dir/$zone/"
61 scp K
$zone+* $server:$dir/$zone/
67 : echo "scp $zonefile $server:$dir/$view/$zone/"
68 scp
$zonefile $server:$dir/$view/$zone/
70 : echo "scp $zonefile $server:$dir/$zone/"
71 scp
$zonefile $server:$dir/$zone/
75 : echo "rndc $action $zone $view"
76 rndc
$action $zone $view
79 usage
"illegal action $action"