3 # $NetBSD: rndctl,v 1.2 2009/02/02 09:24:47 apb Exp $
7 # BEFORE: DISKS ike ipsec sshd
10 $_rc_subr_loaded .
/etc
/rc.subr
14 command="/sbin/${name}"
16 start_cmd
="rndctl_startcmd"
20 # $rndctl_flags can contain multiple semicolon-separated
21 # segments in which each segment contains optional flags
22 # followed by one or more device or type names. If none of the
23 # -c/-C/-e/-E flags is specified, then "-c -e" is used. If
24 # neither of the -d/-t flags is specified, then "-d" is used.
27 # rndctl_flags="wd0 wd1; -t tty; -c -t net"
28 # we will perform the following commands:
36 # Split $rndctl_flags on semicolons
41 # The outer "for args" loop cycles once per semicolon-separated
42 # segment; the inner "for arg" loop cycles once per word in a
45 #echo >&2 "${name} DEBUG: Parsing segment: $args";
47 for arg
in ${args}; do
50 flags
="${flags} ${arg}"
53 # We have a device or type name.
54 # If none of -c/-C/-e/-E flags was
55 # specified, add "-c -e". If neither
56 # of -d/-t was specified, add "-d".
57 # Then perform the command with the
58 # specified device or type name.
60 # Note that -d/-t flag must be last.
64 *) flags
="-c -e ${flags}" ;;
68 *) flags
="${flags} -d" ;;
70 #echo >&2 "${name} DEBUG: running:" \
71 # "$command $flags $arg"
72 $command ${flags} ${arg}