2002-02-11 13:19:55 +03:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-02-11 16:55:42 +03:00
|
|
|
# $NetBSD: ipfs,v 1.3 2002/02/11 13:55:42 lukem Exp $
|
2002-02-11 13:19:55 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
# 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 ${ipfs_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
|
|
|
|
/usr/sbin/ipfs -W ${ipfs_flags}
|
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
2002-02-11 16:55:42 +03:00
|
|
|
run_rc_command "$1"
|