Package cups-pdf: Scripts

Post install

# First install : create the printer if cupsd is running
if [ "$1" -eq "1" ]
then

    service cups status > /dev/null 2>&1
    if [ $? -eq 0 ]; then
        /usr/sbin/lpadmin -p Cups-PDF -v cups-pdf:/ -m CUPS-PDF.ppd -E || :
    else
        service cups start > /dev/null 2>&1 && /usr/sbin/lpadmin -p Cups-PDF -v cups-pdf:/ -m CUPS-PDF.ppd -E || : && service cups stop > /dev/null 2>&1 || :
    fi
fi
Post uninstall

1
2
3
4
if [ "$1" -eq "0" ]; then
    # Delete the printer
    /usr/sbin/lpadmin -x Cups-PDF || :
fi