Sophie

Sophie

distrib > Mandriva > 8.1 > i586 > by-pkgid > 68ca03e6ec94a17ea56bc81915a42477 > files > 13

dynamic-0.4-7mdk.noarch.rpm

#!/bin/sh
#---------------------------------------------------------------
# Project         : Mandrake Linux
# Module          : dynamic
# File            : lp.script
# Version         : $Id: lp.script,v 1.3 2001/09/21 20:17:14 flepied Exp $
# Author          : Frederic Lepied
# Created On      : Thu Sep 13 01:09:08 2001
# License         : GPL
# Purpose         : script run when a new printer is plugged.
#---------------------------------------------------------------

. /etc/dynamic/scripts/functions.script

check_activated $0

MODE=660
OWNER=lp.sys

if [ -x /usr/sbin/update-alternatives ]; then
    TYPE=`/usr/sbin/update-alternatives --display lpr 2> /dev/null | grep currently | cut -f 6 -d ' '`
    case "$TYPE" in
	*lpd)  MODE=660; OWNER=lp.lp;;
	*cups) MODE=660; OWNER=lp.sys;;
	*pdq)  MODE=666;;	# should be done via pam_console
    esac
fi

chmod $MODE $2
chown $OWNER $2

call_hooks $1 lp $2 ""

# lp.script ends here