aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/dracut/90zfs/zfs-needshutdown.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/dracut/90zfs/zfs-needshutdown.sh.in')
-rw-r--r--contrib/dracut/90zfs/zfs-needshutdown.sh.in10
1 files changed, 10 insertions, 0 deletions
diff --git a/contrib/dracut/90zfs/zfs-needshutdown.sh.in b/contrib/dracut/90zfs/zfs-needshutdown.sh.in
new file mode 100644
index 000000000..e3d1b59cc
--- /dev/null
+++ b/contrib/dracut/90zfs/zfs-needshutdown.sh.in
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+type getarg >/dev/null 2>&1 || . /lib/dracut-lib.sh
+
+if zpool list 2>&1 | grep -q 'no pools available' ; then
+ info "ZFS: No active pools, no need to export anything."
+else
+ info "ZFS: There is an active pool, will export it."
+ need_shutdown
+fi