wok-current annotate acpid/stuff/init.d/acpid @ rev 20273

linux: typo
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Mar 18 17:13:32 2018 +0100 (2018-03-18)
parents 7f188676b59c
children
rev   line source
domcox@1512 1 #!/bin/sh
al@19161 2 # /etc/init.d/acpid: Start, stop and restart acpid daemon on SliTaz, at boot
domcox@1512 3 # time or with the command line.
domcox@1512 4 #
domcox@1512 5 # To start daemon at boot time, just put the right name in the $RUN_DAEMONS
domcox@1512 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf.
domcox@1512 7 #
domcox@1512 8 . /etc/init.d/rc.functions
domcox@1512 9 . /etc/daemons.conf
domcox@1512 10
domcox@1512 11 NAME=acpid
al@19161 12 DESC="$(_ 'ACPI event daemon')"
domcox@1512 13 DAEMON=/usr/sbin/acpid
domcox@1512 14 OPTIONS=$ACPID_OPTIONS
domcox@2653 15 PIDFILE=/var/run/acpid.pid
domcox@1512 16
domcox@1512 17 case "$1" in
domcox@1512 18 start)
pascal@11690 19 if active_pidfile $PIDFILE $NAME ; then
al@19159 20 _ '%s is already running.' $NAME
domcox@1512 21 exit 1
domcox@1512 22 fi
al@19159 23 action 'Starting %s: %s...' "$DESC" $NAME
domcox@2653 24 $DAEMON $OPTIONS
domcox@1512 25 status
domcox@1512 26 ;;
domcox@1512 27 stop)
pascal@11690 28 if ! active_pidfile $PIDFILE $NAME ; then
al@19159 29 _ '%s is not running.' $NAME
domcox@1512 30 exit 1
domcox@1512 31 fi
al@19159 32 action 'Stopping %s: %s...' "$DESC" $NAME
al@19159 33 kill $(cat $PIDFILE)
domcox@1512 34 status
domcox@1512 35 ;;
domcox@1512 36 restart)
pascal@11690 37 if ! active_pidfile $PIDFILE $NAME ; then
al@19159 38 _ '%s is not running.' $NAME
domcox@1512 39 exit 1
domcox@1512 40 fi
al@19159 41 action 'Restarting %s: %s...' "$DESC" $NAME
al@19159 42 kill $(cat $PIDFILE)
domcox@1512 43 sleep 2
domcox@2653 44 $DAEMON $OPTIONS
domcox@1512 45 status
domcox@1512 46 ;;
domcox@1512 47 *)
al@19159 48 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
al@19159 49 newline
domcox@1512 50 exit 1
domcox@1512 51 ;;
domcox@1512 52 esac
domcox@1512 53
domcox@1512 54 exit 0