summaryrefslogtreecommitdiff
path: root/sys-fs/zfs-utils/files/zfs-init.sh.in
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-06-05 02:56:15 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-06-05 02:56:15 +0100
commit4594caec9341d17a10db3f9a8c96ec2a9b2c87a6 (patch)
treec62d3d186ef42bbe303a85bef39d8f0983e3fa8a /sys-fs/zfs-utils/files/zfs-init.sh.in
parentb96f6791ecfaf22e1a39f3ccf49479345c353b32 (diff)
give userspace packages a more, userspace name
Diffstat (limited to 'sys-fs/zfs-utils/files/zfs-init.sh.in')
-rw-r--r--sys-fs/zfs-utils/files/zfs-init.sh.in29
1 files changed, 29 insertions, 0 deletions
diff --git a/sys-fs/zfs-utils/files/zfs-init.sh.in b/sys-fs/zfs-utils/files/zfs-init.sh.in
new file mode 100644
index 00000000..ed84585c
--- /dev/null
+++ b/sys-fs/zfs-utils/files/zfs-init.sh.in
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+ZFS="@sbindir@/zfs"
+ZPOOL="@sbindir@/zpool"
+ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache"
+
+if [ -f "${ZPOOL_CACHE}" ]; then
+ "${ZPOOL}" import -c "${ZPOOL_CACHE}" -aN 2>/dev/null
+ if [ "${?}" != "0" ]; then
+ echo "Failed to import not-yet imported pools." >&2
+ fi
+fi
+
+echo "Mounting ZFS filesystems"
+"${ZFS}" mount -a
+if [ "${?}" != "0" ]; then
+ echo "Failed to mount ZFS filesystems." >&2
+ exit 1
+fi
+
+echo "Exporting ZFS filesystems"
+"${ZFS}" share -a
+if [ "${?}" != "0" ]; then
+ echo "Failed to export ZFS filesystems." >&2
+ exit 1
+fi
+
+exit 0
+