PREUN
/bin/sh
/usr/share/rpm-helper/del-service cups-filters $1 cups-browsed
POSTIN
/bin/sh
/usr/share/rpm-helper/add-service cups-filters $1 cups-browsed
# Initial installation
if [ $1 -eq 1 ] ; then
IN=/etc/cups/cupsd.conf
OUT=/etc/cups/cups-browsed.conf
keyword=BrowsePoll
# We can remove this after few releases, it's just for the introduction of cups-browsed.
if [ -f "$OUT" ]; then
echo -e "\n# NOTE: This file is not part of CUPS.\n# You need to enable cups-browsed service\n# and allow ipp-client service in firewall." >> "$OUT"
fi
# move BrowsePoll from cupsd.conf to cups-browsed.conf
if [ -f "$IN" ] && grep -iq ^$keyword "$IN"; then
if ! grep -iq ^$keyword "$OUT"; then
(cat >> "$OUT" <<EOF
# Settings automatically moved from cupsd.conf by RPM package:
EOF
) || :
(grep -i ^$keyword "$IN" >> "$OUT") || :
#systemctl enable cups-browsed.service >/dev/null 2>&1 || :
fi
sed -i -e "s,^$keyword,#$keyword directive moved to cups-browsed.conf\n#$keyword,i" "$IN" || :
fi
fi
POSTUN
/bin/sh
/usr/share/rpm-helper/reread-services cups-filters