summaryrefslogtreecommitdiff
path: root/etc/rc.d/cgd
blob: 55c23b6108bb738c61b4ba35fc53d7ee36ddb7a7 (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
#!/bin/sh
#
# $NetBSD: cgd,v 1.9 2021/08/03 05:15:20 mlelstv Exp $
#

# PROVIDE: cgd
# REQUIRE: rndctl devpubd
# BEFORE:  DISKS
# KEYWORD: interactive

$_rc_subr_loaded . /etc/rc.subr

name="cgd"
rcvar=$name
start_cmd="cgd_start"
stop_cmd=":"

cgd_start()
{
	if [ -f /etc/cgd/cgd.conf ]; then
		print_rc_normal "Configuring CGD devices."
		cgdconfig -C
	fi
}

cgd_stop()
{
	if [ -f /etc/cgd/cgd.conf ]; then
		print_rc_normal "Unconfiguring CGD devices."
		cgdconfig -U
	fi
}

load_rc_config $name
run_rc_command "$1"