nfs 707 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. #INIT 60
  3. . /etc/rc.conf
  4. case $1 in
  5. autostop) ;;
  6. autostart)
  7. test x"${rpcbind:-NO}" = x"NO" && exit 0
  8. exec sh $0 start
  9. ;;
  10. start)
  11. grep -v "^#" /etc/fstab| grep nfs >/dev/null 2>&1
  12. if [ $? -eq 0 ];then
  13. grep nfs /proc/filesystems >/dev/null 2>&1
  14. if [ $? -eq 0 ];then
  15. mkdir -p /var/lib/nfs/rpc_pipefs
  16. mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
  17. mount -a -t nfs
  18. else
  19. logger -t nfs "No nfs support in kernel"
  20. fi
  21. fi
  22. ;;
  23. stop)
  24. grep -v "^#" /etc/fstab| grep nfs >/dev/null 2>&1
  25. if [ $? -eq 0 ];then
  26. umount -a -t nfs
  27. umount /var/lib/nfs/rpc_pipefs
  28. fi
  29. ;;
  30. restart)
  31. sh $0 stop
  32. sh $0 start
  33. ;;
  34. *)
  35. echo "Usage: $0 {start | stop | restart}"
  36. exit 1
  37. ;;
  38. esac
  39. exit $?