1#!/bin/sh 2# preinstall.solaris.sh,v 1.1 2001/08/21 20:33:17 root Exp 3# This is an effort to automate the setup 4# needed to install the LPRng software on the 5# Solaris OS. This is effectively a one way path. 6# You are warned. 7if [ "$VERBOSE_INSTALL" != "" ] ; then set -x; fi 8PATH=/etc:/usr/etc:/usr/bin:/bin:/sbin:/usr/sbin:$PATH 9# remove the init.d entry and links 10for i in /etc/rc*.d/*lp ; do 11 b=`basename $i`; 12 d=`dirname $i`; 13 mv $i $d/UNUSED.$b.UNUSED 14done 15# rename files 16renameit () { 17 for i in $* ; do 18 if [ -f $i -a '!' -f $i.old ] ; then 19 echo "renaming $i $i.old"; 20 mv $i $i.old 21 fi 22 done 23} 24renameit /usr/bin/lp /usr/bin/lpstat /usr/sbin/lpadmin /usr/sbin/lpfilter \ 25 /usr/sbin/lpforms /usr/sbin/lpmove /usr/sbin/lpshut /usr/sbin/lpsystem \ 26 /usr/sbin/lpusers /usr/ucb/lpc /usr/ucb/lpq /usr/ucb/lpr /usr/ucb/lprm \ 27 /usr/ucb/lptest /usr/lib/lp/lpsched /usr/lib/lp/lpNet 28# remove the cron entry 29if [ -f /var/spool/cron/crontabs/lp ] ; then 30 mv /var/spool/cron/crontabs/lp /var/spool/cron/UNUSED.crontabs.lp 31fi 32# comment out inetd.conf entry 33if egrep '^printer' /etc/inetd.conf >/dev/null 2>/dev/null ; then 34 mv /etc/inetd.conf /etc/inetd.conf.bak 35 sed -e 's/^printer/# printer/' </etc/inetd.conf.bak >/etc/inetd.conf 36fi 37# remove the nlsadmin entry 38nlsadmin -r lpd tcp 39nlsadmin -r lp tcp 40# echo REBOOT SYSTEM 41