comparison 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
comparison
equal deleted inserted replaced
1025:21a87230c8a1 1026:3dfef64b81c1
1 #!/bin/sh 1 #!/bin/busybox sh
2 # 2 #
3 # /etc/rc.d/cupsd -- run control script for cupsd 3 # /etc/rc.d/cupsd -- run control script for cupsd
4 # 4 #
5 # Copyright (c) 2019 David Demelier <markand@malikania.fr> 5 # Copyright (c) 2019 David Demelier <markand@malikania.fr>
6 # 6 #
19 19
20 if [ -f /etc/rc.conf ]; then 20 if [ -f /etc/rc.conf ]; then
21 . /etc/rc.conf 21 . /etc/rc.conf
22 fi 22 fi
23 23
24 : ${TEMPLATE_CMD:=/bin/cupsd} 24 : ${CUPSD_CMD:=/bin/cupsd}
25 : ${TEMPLATE_ARGS:=} 25 : ${CUPSD_ARGS:=}
26 : ${TEMPLATE_PID:=/var/run/cups/cupsd.pid} 26 : ${CUPSD_PID:=/var/run/cups/cupsd.pid}
27 27
28 cupsd_start() 28 cupsd_start()
29 { 29 {
30 echo "Starting cupsd: $TEMPLATE_CMD $TEMPLATE_ARGS" 30 if [ -s $CUPSD_PID ]; then
31 $TEMPLATE_CMD $TEMPLATE_ARGS -p $TEMPLATE_PID 31 echo "cupsd is already running with pid: $(cat $CUPSD_PID)"
32 else
33 echo "Starting cupsd: $CUPSD_CMD $CUPSD_ARGS"
34 $CUPSD_CMD $CUPSD_ARGS -p $CUPSD_PID
35 fi
32 } 36 }
33 37
34 cupsd_status() 38 cupsd_status()
35 { 39 {
36 if [ -s $TEMPLATE_PID ]; then 40 if [ -s $CUPSD_PID ]; then
37 echo "cupsd is running with pid: $(cat $TEMPLATE_PID)" 41 echo "cupsd is running with pid: $(cat $CUPSD_PID)"
38 else 42 else
39 echo "cupsd is not running" 43 echo "cupsd is not running"
40 fi 44 fi
41 } 45 }
42 46
43 cupsd_stop() 47 cupsd_stop()
44 { 48 {
45 if [ -s $TEMPLATE_PID ]; then 49 if [ -s $CUPSD_PID ]; then
46 echo "Stopping cupsd." 50 echo "Stopping cupsd."
47 kill -QUIT $(cat $TEMPLATE_PID) 51 kill -QUIT $(cat $CUPSD_PID)
48 fi 52 fi
49 } 53 }
50 54
51 cupsd_restart() 55 cupsd_restart()
52 { 56 {