cifs 672 B

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