mirror of
https://git.freebsd.org/ports.git
synced 2025-06-01 02:46:27 -04:00
literal name_enable wherever possible, and ${name}_enable when it's not, to prepare for the demise of set_rcvar(). In cases where I had to hand-edit unusual instances also modify formatting slightly to be more uniform (and in some cases, correct). This includes adding some $FreeBSD$ tags, and most importantly moving rcvar= to right after name= so it's clear that one is derived from the other.
48 lines
710 B
Bash
48 lines
710 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"
|
|
#
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=sfscd
|
|
rcvar=sfscd_enable
|
|
|
|
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"
|