#!/bin/sh
# Copyright (c) 2004 Oki Data, America, Inc
# All rights reserved

#-----------------------------------------------------
# This script will uninstall OKI's PCL and Post Script drivers.
#-----------------------------------------------------
# version: 1.0
#-----------------------------------------------------

RM="/bin/rm"
ECHO="/bin/echo"
ID="/usr/bin/id"

MODEL="/usr/share/cups/model"
OKI="${MODEL}/Oki"

PPD_4200="${OKI}/ok4200pcl.ppd.gz"
PPD_4300="${OKI}/ok4300pcl.ppd.gz"
PPD_4300u1="${OKI}/ok4300u1.ppd"
PPD_4350u1="${OKI}/ok4350u1.ppd"

MSG="$0: Drivers PCL e Post Script desinstalados com sucesso... OK."

if [ `${ID} -u` -ne 0 ] ; then
        ${ECHO} "$0: must be root!"
        exit 1
fi

if [ ! -d ${MODEL} ] ; then
        ${ECHO} "${MSG}"
        exit 0
fi

if [ ! -d ${OKI} ] ; then
        ${ECHO} "${MSG}"
        exit 0
fi

${RM} -f ${PPD_4200} ${PPD_4300u1} ${PPD_4350u1} ${PPD_4300}
if [ $? -ne 0 ] ; then
	${ECHO} "$0: Desinstalação ... FALHOU!"
	exit 1
else
	${ECHO} "$0: Desinstalação efetuada com sucesso ... OK!"

fi



