wok-next view cups/stuff/etc/init.d/cupsd @ rev 19159

/etc/init.d/*: use 'action' in pair with 'status'.
'action' returns translated message, so why not to add full translatable /etc/init.d/* content
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu May 26 20:16:45 2016 +0300 (2016-05-26)
parents 77dc6129b023
children ff5fd8788cd9
line source
1 #!/bin/sh
2 # /etc/init.d/cups: Start, stop and restart CUPS deamon on SliTaz, at boot
3 # time or with the command line.
4 #
5 # To start daemon at boot time, add 'cupsd' to the $RUN_DAEMONS variable
6 # of /etc/rcS.conf and configure options with /etc/daemons.conf.
7 #
8 . /etc/init.d/rc.functions
9 . /etc/daemons.conf
11 NAME=Cupsd
12 DESC="$(_ '%s daemon' CUPS)"
13 DAEMON=/usr/sbin/cupsd
14 OPTIONS=$CUPSD_OPTIONS
15 PIDFILE=/var/run/cups/cups.sock
17 case "$1" in
18 stop)
19 action 'Stopping %s: %s...' "$DESC" $NAME
20 kill $(pgrep -f cupsd)
21 sleep 2
22 [ -e /var/run/cups/cups.sock ] && rm -f $PIDFILE
23 status
24 ;;
25 start)
26 if ! active_pidfile $PIDFILE cupsd 2>/dev/null; then
27 action 'Starting %s: %s...' "$DESC" $NAME
28 $DAEMON $OPTIONS
29 status
30 else
31 _ '%s is already running.' $NAME
32 fi
33 ;;
34 *)
35 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop]"
36 newline
37 exit 1
38 ;;
39 esac
41 exit 0