Here is a quick script that switches the print spooler on RedHat:

        #!/bin/sh
        #
        help(){
                cat <<EOF 1>&2
        use: $1 [-c][-l]
                change spooler from CUPS to LPRng or vice versa
                -c - change to CUPS
                -l - change to LPRng
        EOF
                exit 1
        }
        lprng=yes;

        while [ "$1" ] ; do
                case "$1" in
                -c ) lprng="no";;
                -l ) lprng="yes";;
                *) help;;
                esac
                shift
        done

        if [ "$lprng" = "yes" ] ; then
                echo changing spooler to LPRng
                chkconfig cups off
                service cups stop
                if [ -f /etc/xinetd.d/cups-lpd ] ; then
                        perl -spi -e 's/disable.*/disable = yes/' 
/etc/xinetd.d/cups-lpd
                        killall -HUP xinetd
                fi
                sleep 2
                if [ -f /etc/printcap.lpd ] ; then
                        cp /etc/printcap.lpd /etc/printcap
                fi
                chkconfig lpd on
                service lpd start
        else
                echo changing spooler to CUPS
                chkconfig lpd off
                service lpd stop
                if [ -f /etc/printcap ] ; then
                        cp /etc/printcap /etc/printcap.lpd
                fi
                sleep 2
                chkconfig cups on
                if [ -f /etc/xinetd.d/cups-lpd ] ; then
                        perl -spi -e 's/disable.*/disable = no/' /etc/xinetd.d/cups-lpd
                        killall -HUP xinetd
                fi
                service cups start
        fi

Patrick Powell                 Astart Technologies
[EMAIL PROTECTED]            6741 Convoy Court
Network and System             San Diego, CA 92111
  Consulting                   858-874-6543 FAX 858-751-2435
LPRng - Print Spooler (http://www.lprng.com)

-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to