PREIN
/bin/sh
if [ $1 = "1" ]; then # first installation
# for diald config
grep -q '^alias tap0' /etc/modules.conf || {
echo "alias tap0 ethertap" >> /etc/modules.conf
echo "options tap0 -o tap0 unit=0" >> /etc/modules.conf
}
fi
PREUN
/bin/sh
/usr/share/rpm-helper/del-service diald $1 diald
POSTIN
/bin/sh
/usr/share/rpm-helper/add-service diald $1 diald
POSTUN
/bin/sh
if [ $1 = "0" ]; then # full removal
# diald unload modules
perl -ni -e 'print unless ( m!^.*tap0.*$! || /^\s*$/)' /etc/modules.conf
fi