diff options
Diffstat (limited to 'etc/rc.d/ipfs')
-rwxr-xr-x | etc/rc.d/ipfs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/etc/rc.d/ipfs b/etc/rc.d/ipfs new file mode 100755 index 0000000..0abdba0 --- /dev/null +++ b/etc/rc.d/ipfs @@ -0,0 +1,36 @@ +#!/bin/sh +# +# $NetBSD: ipfs,v 1.3 2002/02/11 13:55:42 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" |