Sophie

Sophie

distrib > Mageia > 7 > i586 > media > core-release > by-pkgid > 9ffd4cb973f276666d50d5da485c16a2 > scriptlet

cups-filters-1.22.5-1.mga7.i586.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.\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