2010-03-14 23:48:48 +08:00
|
|
|
post_install() {
|
2011-11-02 03:54:33 +08:00
|
|
|
if [ -x usr/bin/xdg-icon-resource ]; then
|
|
|
|
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
|
|
|
|
fi
|
|
|
|
|
|
|
|
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."
|
2010-03-14 23:48:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
post_upgrade() {
|
2011-11-02 03:54:33 +08:00
|
|
|
if [ -x usr/bin/xdg-icon-resource ]; then
|
|
|
|
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$(vercmp "${2}" 1.4.7-2)" -lt 0 ]; then
|
2011-11-01 08:17:30 +08:00
|
|
|
# important upgrade notice
|
2011-11-02 03:54:33 +08:00
|
|
|
echo "The CUPS daemon script has been renamed to /etc/rc.d/cupsd"
|
|
|
|
echo "Change your entry in /etc/rc.conf"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# If the "lp" user group is still present, and the user has not changed the cupsd.conf
|
|
|
|
# from the old default "SystemGroup sys root" setting, let's replace that line, so that
|
|
|
|
# it will also allow for the "lp" user group to administrate CUPS.
|
|
|
|
# Without this, non-root users will see the Printers KCM silently hang (the CUPS server
|
|
|
|
# will deny access).
|
|
|
|
|
|
|
|
local cupsd=etc/cups/cupsd.conf
|
|
|
|
|
|
|
|
if ( getent group lp && grep '^SystemGroup sys root$' "${cupsd}") &>/dev/null; then
|
|
|
|
echo "[NOTICE] the CUPS configuration is being automatically tweaked to allow all users belonging to the \"lp\" group to administrate the server."
|
|
|
|
sed -i 's/^SystemGroup sys root$/SystemGroup sys root lp/g' "${cupsd}"
|
2011-11-01 08:17:30 +08:00
|
|
|
fi
|
2010-03-14 23:48:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
post_remove() {
|
2011-11-01 08:17:30 +08:00
|
|
|
if [ -x usr/bin/xdg-icon-resource ]; then
|
|
|
|
xdg-icon-resource forceupdate --theme hicolor 2> /dev/null
|
|
|
|
fi
|
2010-03-14 23:48:48 +08:00
|
|
|
}
|