diff print/cups/cupsd @ 1026:3dfef64b81c1

vanilla: update all init scripts
author David Demelier <markand@malikania.fr>
date Thu, 29 Aug 2019 20:34:00 +0200
parents 98351d3f57eb
children ef803d8555ec
line wrap: on
line diff
--- a/print/cups/cupsd	Thu Aug 29 20:33:00 2019 +0200
+++ b/print/cups/cupsd	Thu Aug 29 20:34:00 2019 +0200
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/busybox sh
 #
 # /etc/rc.d/cupsd -- run control script for cupsd
 #
@@ -21,20 +21,24 @@
 	. /etc/rc.conf
 fi
 
-: ${TEMPLATE_CMD:=/bin/cupsd}
-: ${TEMPLATE_ARGS:=}
-: ${TEMPLATE_PID:=/var/run/cups/cupsd.pid}
+: ${CUPSD_CMD:=/bin/cupsd}
+: ${CUPSD_ARGS:=}
+: ${CUPSD_PID:=/var/run/cups/cupsd.pid}
 
 cupsd_start()
 {
-	echo "Starting cupsd: $TEMPLATE_CMD $TEMPLATE_ARGS"
-	$TEMPLATE_CMD $TEMPLATE_ARGS -p $TEMPLATE_PID
+	if [ -s $CUPSD_PID ]; then
+		echo "cupsd is already running with pid: $(cat $CUPSD_PID)"
+	else
+		echo "Starting cupsd: $CUPSD_CMD $CUPSD_ARGS"
+		$CUPSD_CMD $CUPSD_ARGS -p $CUPSD_PID
+	fi
 }
 
 cupsd_status()
 {
-	if [ -s $TEMPLATE_PID ]; then
-		echo "cupsd is running with pid: $(cat $TEMPLATE_PID)"
+	if [ -s $CUPSD_PID ]; then
+		echo "cupsd is running with pid: $(cat $CUPSD_PID)"
 	else
 		echo "cupsd is not running"
 	fi
@@ -42,9 +46,9 @@
 
 cupsd_stop()
 {
-	if [ -s $TEMPLATE_PID ]; then
+	if [ -s $CUPSD_PID ]; then
 		echo "Stopping cupsd."
-		kill -QUIT $(cat $TEMPLATE_PID)
+		kill -QUIT $(cat $CUPSD_PID)
 	fi
 }