PREIN
/bin/sh
getent group pkcs11 >/dev/null || groupadd -r pkcs11
# Add root to the pkcs11 group
/usr/sbin/usermod -G $(/usr/bin/id --groups --name root | /bin/sed -e '
# add the pkcs group if it is missing
/(^| )pkcs11( |$)/!s/$/ pkcs11/
# replace spaces by commas
y/ /,/
'),pkcs11 root
exit 0
PREUN
/bin/sh
if [ "$1" = "0" ] ; then
/sbin/service pkcsslotd stop >/dev/null 2>&1
/sbin/chkconfig --del pkcsslotd
fi
exit 0
POSTIN
/bin/sh
/sbin/chkconfig --add pkcsslotd
exit 0
POSTUN
/bin/sh
if [ "$1" -ge "1" ] ; then
/sbin/service pkcsslotd condrestart >/dev/null 2>&1
fi
exit 0