add_daemon() { checkdmn=$(grep ^DAEMONS /etc/rc.conf | grep cups) if [ "$checkdmn" = "" ]; then sed -i '/^DAEMONS/{s/)$/ cups)/}' /etc/rc.conf fi } post_install() { xdg-icon-resource forceupdate --theme hicolor 2> /dev/null echo ">> If you use an HTTPS connection to CUPS, the first time you access" echo ">> the interface it may take a very long time before the site comes up." echo ">> This is because the first request triggers the generation of the CUPS" echo ">> SSL certificates which can be a very time-consuming job." add_daemon /etc/rc.d/cups restart } post_upgrade() { xdg-icon-resource forceupdate --theme hicolor 2> /dev/null add_daemon /etc/rc.d/cups restart } pre_remove() { /etc/rc.d/cups stop } post_remove() { xdg-icon-resource forceupdate --theme hicolor 2> /dev/null sed -i '/^DAEMONS/{s/ cups)$/)/}' /etc/rc.conf }