2011-11-02 02:59:33 +08:00
|
|
|
add_daemon() {
|
|
|
|
checkdmn=$(grep ^DAEMONS /etc/rc.conf | grep cups)
|
|
|
|
if [ "$checkdmn" = "" ]; then
|
|
|
|
sed -i '/^DAEMONS/{s/)$/ cups)/}' /etc/rc.conf
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2010-03-14 23:48:48 +08:00
|
|
|
post_install() {
|
2011-11-02 02:59:33 +08:00
|
|
|
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
|
2010-03-14 23:48:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
post_upgrade() {
|
2011-11-02 02:59:33 +08:00
|
|
|
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
|
|
|
|
add_daemon
|
|
|
|
/etc/rc.d/cups restart
|
|
|
|
}
|
|
|
|
|
|
|
|
pre_remove() {
|
|
|
|
/etc/rc.d/cups stop
|
2010-03-14 23:48:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
post_remove() {
|
2011-11-02 02:59:33 +08:00
|
|
|
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
|
|
|
|
sed -i '/^DAEMONS/{s/ cups)$/)/}' /etc/rc.conf
|
2010-03-14 23:48:48 +08:00
|
|
|
}
|