PREUN
/bin/sh
/usr/share/rpm-helper/del-service zfs-fuse $1 zfs-fuse
POSTIN
/bin/sh
# Move cache if upgrading
oldcache=/etc/zfs/zpool.cache # this changed per 0.6.9, only needed when upgrading from earlier versions
newcache=/var/lib/zfs/zpool.cache
if [[ -f $oldcache && ! -e $newcache ]]; then
echo "Moving existing zpool.cache to new location"
mkdir -p $(dirname $newcache)
mv $oldcache $newcache
else
if [ -e $oldcache ]; then
echo "Note: old zpool.cache present but no longer used ($oldcache)"
fi
fi
/usr/share/rpm-helper/add-service zfs-fuse $1 zfs-fuse
POSTUN
/bin/sh
if [ $1 -ge 1 ] && [ -x /usr/bin/systemctl ]; then
# Package upgrade, not uninstall
/usr/bin/systemctl try-restart zfs-fuse.service || :
fi
echo "Removing files since we removed the last package"
rm -rf /var/run/zfs
rm -rf /var/lock/zfs