2002-02-11 13:19:55 +03:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2004-08-13 22:08:03 +04:00
|
|
|
# $NetBSD: ipfs,v 1.7 2004/08/13 18:08:03 mycroft Exp $
|
2002-02-11 13:19:55 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: ipfs
|
2004-07-05 12:21:15 +04:00
|
|
|
# REQUIRE: ipnat mountcritremote downinterfaces isdnd
|
|
|
|
# BEFORE: SERVERS
|
2002-02-11 13:19:55 +03:00
|
|
|
# KEYWORD: shutdown
|
|
|
|
|
2004-08-13 22:08:03 +04:00
|
|
|
$_rc_subr_loaded . /etc/rc.subr
|
2002-02-11 13:19:55 +03:00
|
|
|
|
|
|
|
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
|
2002-03-22 07:16:38 +03:00
|
|
|
/usr/sbin/ipfs -R ${rc_flags}
|
2002-02-11 16:55:42 +03:00
|
|
|
rm -f /var/db/ipf/ipstate.ipf /var/db/ipf/ipnat.ipf
|
2002-02-11 13:19:55 +03:00
|
|
|
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
|
2002-03-22 07:16:38 +03:00
|
|
|
/usr/sbin/ipfs -W ${rc_flags}
|
2002-02-11 13:19:55 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
2002-02-11 16:55:42 +03:00
|
|
|
run_rc_command "$1"
|