aboutsummaryrefslogtreecommitdiff
path: root/sysutils/diskprep/files/diskprep.in
blob: 8c16c8ef0db4d7e074300889a48b1db449418945 (plain) (blame)
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
39
#!/bin/sh
# $Aero: util/diskprep/diskprep.rc,v 1.1 2005/08/06 00:50:59 brooks Exp $

# PROVIDE: diskprep
# REQUIRE: disks
# BEFORE: fsck localswap
# KEYWORD: nojail

rc_debug=YES

. /etc/rc.subr

name="diskprep"
rc_var=`set_rcvar`
start_precmd="diskprep_prestart"
stop_cmd=":"
command="/usr/local/sbin/diskprep"

diskprep_prestart()
{
	if [ -n "${diskprep_label}" ]; then
		# If our label exists, we're done.
		if [ -c /dev/label/${curlabel} ]; then
			return 0
		fi
		command_args="$command_args -l $diskprep_label"
	fi
	if [ -n "${diskprep_config}" ]; then
		command_args="$command_args -c $diskprep_config"
	fi
	if [ -z "${diskprep_disk}" -o ! -c "/dev/${diskprep_disk}" ]; then
		err 1 "diskprep enabled, but no disk found!"
	fi
	command_args="$command_args $diskprep_disk"
}

load_rc_config $name

run_rc_command "$1"