freebsd-ports/security/sfs/files/sfscd.in

49 lines
709 B
Text
Raw Normal View History

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: sfscd
# REQUIRE: NETWORKING
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable the sfscd daemon:
#
# sfscd_enable="YES"
#
. /etc/rc.subr
name=sfscd
rcvar=`set_rcvar`
command="%%PREFIX%%/sbin/${name}"
pidfile="/var/run/${name}.pid"
stop_cmd=stop_cmd
stop_cmd() {
echo "Stopping ${name}"
users_mounts=`mount | awk '/^@.* on \./ { print $1 }'`
if [ -n $user_mounts] ; then
`echo $users_mounts | xargs umount -f`
fi
if [ -d /sfs/.mnt ] ; then
for dir in /sfs/.mnt/*; do
umount -f $dir
done
umount -f /sfs
fi
pkill -9 nfsmounter
}
# set defaults
sfscd_enable=${sfscd_enable:-"NO"}
load_rc_config ${name}
run_rc_command "$1"