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