]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - cups.sh.in
Merge changes from 1.1.x into 1.2 devel.
[thirdparty/cups.git] / cups.sh.in
index a1c3bffef194c707823791ea31a929b9c08bce2f..2734ffbed10152c961d7a549c9a2585ebc032356 100755 (executable)
@@ -1,6 +1,6 @@
 #!/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).
 #
@@ -28,7 +28,7 @@
 #
 #   Linux chkconfig stuff:
 #
-#   chkconfig: 0235 99 00
+#   chkconfig: 235 99 00
 #   description: Startup/shutdown script for the Common UNIX \
 #                Printing System (CUPS).
 #
@@ -43,6 +43,7 @@
 
 
 #### OS-Dependent Configuration
+
 case "`uname`" in
        IRIX*)
                IS_ON=/sbin/chkconfig
@@ -52,6 +53,31 @@ case "`uname`" in
                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
                ;;
@@ -65,10 +91,14 @@ esac
 # 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
 
 #
@@ -76,14 +106,22 @@ 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=""
@@ -139,5 +177,5 @@ exit 0
 
 
 #
-# 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 $".
 #