1a286b1407
make them "externally" available: Previous Current Purpose -------- ------- ------- _arg rc_arg Argument to command, after fast/force processing performed (and prefix removed) _flags rc_flags Flags to start the default command with. Defaults to ${name}_flags, unless overridden by $flags from the environment. This variable may be changed by the precmd method. _pid rc_pid PID of command (if appropriate). _rc_run_fast rc_fast Not empty is "fast" was provided. _rc_run_force rc_force Not empty is "force" was provided. - Use rc_flags instead of _flags or ${name}_flags in various rc.d scripts, so that $flags from the environment overrides ${name}_flags from rc.conf(5). Fixes [bin/15800].
37 lines
600 B
Bash
Executable File
37 lines
600 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# $NetBSD: ipfs,v 1.4 2002/03/22 04:16:39 lukem Exp $
|
|
#
|
|
|
|
# PROVIDE: ipfs
|
|
# REQUIRE: ipnat mountcritremote
|
|
# KEYWORD: shutdown
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="ipfs"
|
|
rcvar=$name
|
|
start_cmd="ipfs_start"
|
|
stop_cmd="ipfs_stop"
|
|
|
|
ipfs_start()
|
|
{
|
|
if [ -r /var/db/ipf/ipstate.ipf -a -r /var/db/ipf/ipnat.ipf ]; then
|
|
/usr/sbin/ipfs -R ${rc_flags}
|
|
rm -f /var/db/ipf/ipstate.ipf /var/db/ipf/ipnat.ipf
|
|
fi
|
|
}
|
|
|
|
ipfs_stop()
|
|
{
|
|
if [ ! -d /var/db/ipf ]; then
|
|
mkdir /var/db/ipf
|
|
chmod 700 /var/db/ipf
|
|
chown root:wheel /var/db/ipf
|
|
fi
|
|
/usr/sbin/ipfs -W ${rc_flags}
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|