Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 29d4f2f97042ccc59632d568d0dbf352 > scriptlet

cups-filters-1.0.53-1.mga4.x86_64.rpm

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. You need to start&enable cups-browsed service." >> "$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