blob: b1971f429a5f5e82125ebcfc112cb891e61f5380 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#!/bin/sh
#
# $OpenBSD: nsd,v 1.8 2014/06/25 12:33:33 sthen Exp $
daemon="/usr/sbin/nsd-control"
daemon_flags="-c /var/nsd/etc/nsd.conf"
. /etc/rc.d/rc.subr
pexp="nsd${daemon_flags:+ ${daemon_flags}}"
rc_usercheck=NO
rc_pre() {
if ! [[ -f /var/nsd/etc/nsd_server.key ||
-f /var/nsd/etc/nsd_server.pem ||
-f /var/nsd/etc/nsd_control.key ||
-f /var/nsd/etc/nsd_control.pem ]]; then
/usr/sbin/nsd-control-setup >/dev/null 2>&1
fi
}
rc_start() {
${rcexec} "${daemon} ${daemon_flags} start"
}
rc_check() {
${daemon} ${daemon_flags} status || return 1
}
rc_reload() {
${daemon} ${daemon_flags} reconfig && ${daemon} ${daemon_flags} reload
}
rc_stop() {
${daemon} ${daemon_flags} stop
}
rc_cmd $1
|