nfs.init 723 B

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