shinyscripts/daemon/netfs

37 lines
602 B
Plaintext
Raw Normal View History

2022-11-13 11:46:30 +01:00
#!/bin/bash
# sourcing our current rc.conf requires this to be a bash script
. /etc/rc.conf
. /etc/rc.d/functions
case "$1" in
start)
stat_busy "Mounting network filesystems"
mount -a -t "$NETFS"
rc=$?
mount -a -O _netdev
(( rc || $? )) && stat_die
add_daemon netfs
stat_done
;;
stop)
stat_busy "Unmounting network filesystems"
umount -a -f -O _netdev
rc=$?
umount -a -f -t "$NETFS"
(( rc || $? )) && stat_die
rm_daemon netfs
stat_done
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
exit 1
esac
# vim: set ts=2 noet: