summaryrefslogtreecommitdiffstats
path: root/contrib/debian/openzfs-zfs-zed.postinst
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/debian/openzfs-zfs-zed.postinst')
-rw-r--r--contrib/debian/openzfs-zfs-zed.postinst20
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/debian/openzfs-zfs-zed.postinst b/contrib/debian/openzfs-zfs-zed.postinst
new file mode 100644
index 000000000..a615eec95
--- /dev/null
+++ b/contrib/debian/openzfs-zfs-zed.postinst
@@ -0,0 +1,20 @@
+#!/bin/sh
+set -e
+
+zedd="/usr/lib/zfs-linux/zed.d"
+etcd="/etc/zfs/zed.d"
+
+# enable all default zedlets that are not overridden
+while read -r file ; do
+ etcfile="${etcd}/${file}"
+ [ -e "${etcfile}" ] && continue
+ ln -sfT "${zedd}/${file}" "${etcfile}"
+done < "${zedd}/DEFAULT-ENABLED"
+
+# remove the overrides created in prerm
+find "${etcd}" -maxdepth 1 -lname '/dev/null' -delete
+# remove any dangling symlinks to old zedlets
+find "${etcd}" -maxdepth 1 -lname "${zedd}/*" -xtype l -delete
+
+#DEBHELPER#
+