updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / opendnssec / opendnssec.rcd
blobd6fcc65c321cc3636f9eb476a33bc0083fb77e5b
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 case $1 in
7 start)
8 stat_busy "Starting OpenDNSSEC"
9 ods-control start > /dev/null 2> /dev/null
10 if [ $? -gt 0 ]; then
11 stat_fail
12 exit 1
13 else
14 add_daemon opendnssec
15 stat_done
18 stop)
19 stat_busy "Stopping OpenDNSSEC"
20 ods-control stop > /dev/null 2> /dev/null
21 if [ $? -gt 0 ]; then
22 stat_fail
23 exit 1
24 else
25 rm_daemon opendnssec
26 stat_done
29 restart)
30 $0 stop
31 $0 start
33 status)
34 stat_busy "Checking OpenDNSSEC status";
35 ck_status opendnssec
37 setup)
38 stat_busy "Initializing OpenDNSSEC database"
39 ods-ksmutil setup 2> /dev/null
40 if [ $? -gt 0 ]; then
41 stat_fail
42 else
43 stat_done
46 reload)
47 stat_busy "Reloading OpenDNSSEC configuration"
48 ods-ksmutil update all > /dev/null 2> /dev/null
49 if [ $? -gt 0 ]; then
50 stat_fail
51 else
52 stat_done
55 resign)
56 stat_busy "OpenDNSSEC re-signing all zones"
57 ods-control signer sign --all > /dev/null 2> /dev/null
58 if [ $? -gt 0 ]; then
59 stat_fail
60 else
61 stat_done
65 echo "usage: $0 {start|stop|restart|status|setup|reload|resign}"
66 echo " setup Initialize OpenDNSSEC databases"
67 echo " reload Reload OpenDNSSEC configuration"
68 echo " resign Re-sign all DNS zones"
69 echo ""
70 echo "Note: Restarting the server does not reload the configuration"
71 echo " It must be done explictly ($0 reload)"
72 exit 1
73 esac