NetBSD/etc/rc.d/ipfs
martti d7bcd10a27 ipfs allows state information created for NAT entries and rules using
keep state to be locked (modification prevented) and then saved to disk,
allowing for the system to experience a reboot, followed by the restoration
of that information, resulting in connections not being interrupted.

To activate this feature, set ipfs=YES in /etc/rc.conf
2002-02-11 10:19:55 +00:00

38 lines
613 B
Bash
Executable File

#!/bin/sh
#
# $NetBSD: ipfs,v 1.1 2002/02/11 10:19:55 martti 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 ${ipfs_flags}
rm -f /var/db/ipf/ipstate.ipf
rm -f /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 ${ipfs_flags}
}
load_rc_config $name
run_rc_command "$1"