2009-10-08 03:40:19 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# sourcing our current rc.conf requires this to be a bash script
|
|
|
|
. /etc/rc.conf
|
|
|
|
. /etc/rc.d/functions
|
|
|
|
|
|
|
|
rc=0
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
stat_busy "Mounting Network Filesystems"
|
2011-05-26 04:45:00 +00:00
|
|
|
/bin/mount -a -t nfs,nfs4,smbfs,codafs,ncpfs,cifs,shfs,glusterfs,fuse,fuseblk,fuse.glusterfs,davfs
|
2009-10-08 03:40:19 +00:00
|
|
|
rc=$?
|
|
|
|
/bin/mount -a -O _netdev
|
2011-05-26 04:45:00 +00:00
|
|
|
if ((rc + $? > 0)); then
|
2009-10-08 03:40:19 +00:00
|
|
|
stat_fail
|
|
|
|
else
|
|
|
|
add_daemon netfs
|
|
|
|
stat_done
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
stat_busy "Unmounting Network Filesystems"
|
|
|
|
/bin/umount -a -O _netdev
|
|
|
|
rc=$?
|
2011-05-26 04:45:00 +00:00
|
|
|
/bin/umount -a -t nfs,nfs4,smbfs,codafs,ncpfs,cifs,shfs,glusterfs,fuse,fuseblk,fuse.glusterfs,davfs
|
|
|
|
if ((rc + $? > 0)); then
|
2009-10-08 03:40:19 +00:00
|
|
|
stat_fail
|
|
|
|
else
|
|
|
|
rm_daemon netfs
|
|
|
|
stat_done
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
$0 stop
|
|
|
|
sleep 1
|
|
|
|
$0 start
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "usage: $0 {start|stop|restart}"
|
|
|
|
esac
|
|
|
|
|
|
|
|
# vim: set ts=2 noet:
|