#!/bin/sh
#
-# "$Id: cups.sh.in,v 1.9 2001/03/14 22:02:17 mike Exp $"
+# "$Id: cups.sh.in,v 1.9.2.2 2001/12/26 16:52:05 mike Exp $"
#
# Startup/shutdown script for the Common UNIX Printing System (CUPS).
#
#
# Linux chkconfig stuff:
#
-# chkconfig: 0235 99 00
+# chkconfig: 235 99 00
# description: Startup/shutdown script for the Common UNIX \
# Printing System (CUPS).
#
#### OS-Dependent Configuration
+
case "`uname`" in
IRIX*)
IS_ON=/sbin/chkconfig
IS_ON=:
;;
+ Darwin*)
+ . /etc/rc.common
+
+ if test "${CUPS:=-YES-}" = "-NO-"; then
+ exit 0
+ fi
+
+ IS_ON=:
+ ;;
+
+ Linux*)
+ # Set the timezone, if possible...
+ if test -f /etc/TIMEZONE; then
+ . /etc/TIMEZONE
+ else
+ if test -f /etc/sysconfig/clock; then
+ . /etc/sysconfig/clock
+ TZ="$ZONE"
+ export TZ
+ fi
+ fi
+
+ IS_ON=/bin/true
+ ;;
+
*)
IS_ON=/bin/true
;;
# all but IRIX, which can configure verbose bootup messages.
#
-if $IS_ON verbose; then
- ECHO=echo
+if test "`uname`" = "Darwin"; then
+ ECHO=ConsoleMessage
else
- ECHO=:
+ if $IS_ON verbose; then
+ ECHO=echo
+ else
+ ECHO=:
+ fi
fi
#
#
case "`uname`" in
- IRIX* | HP-UX* | SunOS*)
- pid=`ps -e | awk '{print $1,$4}' | grep cupsd | awk '{print $1}'`
+<<<<<<< cups.sh.in
+ IRIX* | HP-UX* | AIX* | SINIX*)
+ pid=`ps -e | awk '{if (match($4, ".*/cupsd$") || $4 == "cupsd") print $1}'`
+ ;;
+ SunOS*)
+ pid=`ps -e | nawk '{if (match($4, ".*/cupsd$") || $4 == "cupsd") print $1}'`
+ ;;
+ UnixWare*)
+ pid=`ps -e | awk '{if (match($6, ".*/cupsd$") || $6 == "cupsd") print $1}'`
+ . /etc/TIMEZONE
;;
OSF1*)
- pid=`ps -e | awk '{print $1,$5}' | grep cupsd | awk '{print $1}'`
+ pid=`ps -e | awk '{if (match($5, ".*/cupsd$") || $5 == "cupsd") print $1}'`
;;
- Linux* | NetBSD*)
- pid=`ps ax | awk '{print $1,$5}' | grep cupsd | awk '{print $1}'`
+ Linux* | *BSD* | Darwin*)
+ pid=`ps ax | awk '{if (match($5, ".*/cupsd$") || $5 == "cupsd") print $1}'`
;;
*)
pid=""
#
-# End of "$Id: cups.sh.in,v 1.9 2001/03/14 22:02:17 mike Exp $".
+# End of "$Id: cups.sh.in,v 1.9.2.2 2001/12/26 16:52:05 mike Exp $".
#