#!/bin/bash

set -e

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

    if [[ ${TARGET} ]]; then
      chroot ${TARGET} depmod
    else
      depmod
    fi
    ;;
  prerm)
    exit 0
    ;;
  postrm)
    exit 0
    ;;
esac
