#!/bin/sh

set -e

case $1 in
  preinst)
    exit 0
    ;;
  postinst)
    if [ ! -f /etc/default/zfs ]; then
      cp /usr/share/zfs/zfs.default /etc/default/zfs
    fi

    if [ ! -f /usr/share/mkinitramfs/mods/zfs ]; then
      cp /usr/share/zfs/zfs.mods /usr/share/mkinitramfs/mods/zfs
    fi
    if [ ! -f /usr/share/mkinitramfs/bins/zfs ]; then
      cp /usr/share/zfs/zfs.bins /usr/share/mkinitramfs/bins/zfs
    fi

    depmod
    ;;
  prerm)
    exit 0
    ;;
  postrm)
    exit 0
    ;;
esac
