wok view motion/stuff/init.d/motion @ rev 22741

updated drupal (8.6.10 -> 8.8.1)
author Hans-G?nter Theisgen
date Fri Jan 24 07:57:43 2020 +0100 (2020-01-24)
parents 3c13a1e665f2
children 7c04901ef470
line source
1 #!/bin/sh
2 # /etc/init.d/motion: Start, stop and restart Motion daemon on SliTaz,
3 # at boot time or with the command line. Daemons options are configured
4 # with /etc/daemons.conf
5 #
6 . /etc/init.d/rc.functions
8 NAME=Motion
9 DESC="$(_ 'Video detection daemon')"
10 DAEMON=/usr/bin/motion
11 PIDFILE=/run/motion/motion.pid
13 case "$1" in
14 start)
15 if active_pidfile $PIDFILE motion ; then
16 _ '%s is already running.' $NAME
17 exit 1
18 fi
19 action 'Starting %s: %s...' "$DESC" $NAME
20 mkdir -p $(dirname $PIDFILE)
21 $DAEMON -p $PIDFILE
22 status
23 ;;
24 stop)
25 if ! active_pidfile $PIDFILE motion ; then
26 _ '%s is not running.' $NAME
27 exit 1
28 fi
29 action 'Stopping %s: %s...' "$DESC" $NAME
30 kill $(cat $PIDFILE)
31 rm $PIDFILE
32 status
33 ;;
34 restart)
35 if ! active_pidfile $PIDFILE motion ; then
36 echo "$NAME is not running."
37 exit 1
38 fi
39 _ 'Restarting %s: %s...' "$DESC" $NAME
40 kill $(cat $PIDFILE)
41 rm $PIDFILE
42 sleep 2
43 $DAEMON -p $PIDFILE
44 status
45 ;;
46 *)
47 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
48 newline
49 exit 1 ;;
50 esac
52 exit 0