core/cups/cups.install

42 lines
1.6 KiB
Plaintext
Raw Normal View History

2010-03-14 23:48:48 +08:00
post_install() {
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() {
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
# important upgrade notice
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}"
fi
2010-03-14 23:48:48 +08:00
}
post_remove() {
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
}