zfs-init.sh.in 582 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. ZFS="@sbindir@/zfs"
  3. ZPOOL="@sbindir@/zpool"
  4. ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache"
  5. if [ -f "${ZPOOL_CACHE}" ]; then
  6. "${ZPOOL}" import -c "${ZPOOL_CACHE}" -aN 2>/dev/null
  7. if [ "${?}" != "0" ]; then
  8. echo "Failed to import not-yet imported pools." >&2
  9. fi
  10. fi
  11. echo "Mounting ZFS filesystems"
  12. "${ZFS}" mount -a
  13. if [ "${?}" != "0" ]; then
  14. echo "Failed to mount ZFS filesystems." >&2
  15. exit 1
  16. fi
  17. echo "Exporting ZFS filesystems"
  18. "${ZFS}" share -a
  19. if [ "${?}" != "0" ]; then
  20. echo "Failed to export ZFS filesystems." >&2
  21. exit 1
  22. fi
  23. exit 0