forked from Lainports/freebsd-ports
literal name_enable wherever possible, and ${name}_enable
when it's not, to prepare for the demise of set_rcvar().
In cases where I had to hand-edit unusual instances also
modify formatting slightly to be more uniform (and in
some cases, correct). This includes adding some $FreeBSD$
tags, and most importantly moving rcvar= to right after
name= so it's clear that one is derived from the other.
42 lines
871 B
Bash
42 lines
871 B
Bash
#!/bin/sh
|
|
# $Aero: util/diskprep/diskprep.rc,v 1.1 2005/08/06 00:50:59 brooks Exp $
|
|
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: diskprep
|
|
# REQUIRE: disks
|
|
# BEFORE: fsck localswap
|
|
# KEYWORD: nojail
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="diskprep"
|
|
rcvar=diskprep_enable
|
|
|
|
load_rc_config $name
|
|
|
|
# Needs default value for _enable ??
|
|
|
|
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/${diskprep_label} ]; 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"
|
|
}
|
|
|
|
run_rc_command "$1"
|