summaryrefslogtreecommitdiff
path: root/package/motion/files/motion.init
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2011-10-12 21:10:52 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2011-10-12 21:10:52 +0200
commit681a668edf704bbb000a49c835b3d71fa7035d86 (patch)
tree27df7d51e37260f63812466b31369c1a144cdc45 /package/motion/files/motion.init
parent2d1f73d4334593134d3a47704a2614ffcae384ae (diff)
parent6c2bc15eb5c40548f6a98c37ab0b825b9c163343 (diff)
Merge branch 'master' of git+ssh://openadk.org/git/openadk
Diffstat (limited to 'package/motion/files/motion.init')
-rw-r--r--package/motion/files/motion.init27
1 files changed, 27 insertions, 0 deletions
diff --git a/package/motion/files/motion.init b/package/motion/files/motion.init
new file mode 100644
index 000000000..1c8b7e705
--- /dev/null
+++ b/package/motion/files/motion.init
@@ -0,0 +1,27 @@
+#!/bin/sh
+#PKG motion
+#INIT 80
+. /etc/rc.conf
+
+case $1 in
+autostop) ;;
+autostart)
+ test x"${motion:-NO}" = x"NO" && exit 0
+ exec sh $0 start
+ ;;
+start)
+ [ -f /etc/motion.conf ] || exit
+ /usr/bin/motion
+ ;;
+stop)
+ kill $(pgrep -f /usr/bin/motion)
+ ;;
+restart)
+ sh $0 stop
+ sh $0 start
+ ;;
+*)
+ echo "Usage: $0 {start | stop | restart}"
+ ;;
+esac
+exit $?