d5f5e23777
- Bump PORTREVISION. PR: ports/116966 Submitted by: Dave Grochowski <malus.x@gmail.com> (maintainer) Approved by: stas (mentor, implicit)
48 lines
708 B
Bash
48 lines
708 B
Bash
#!/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"
|
|
#
|
|
|
|
. %%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"
|