summaryrefslogtreecommitdiff
path: root/package/motion/files/motion.init
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2011-09-19 21:07:37 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2011-09-19 21:07:37 +0200
commit7f68c00d0201efb725ae5e959d63105168ce82ea (patch)
treeece44562d695f79e2dc590623705838300926190 /package/motion/files/motion.init
parent65cd7b7d328e4ca6e0b2e074b442aa5933cd90d8 (diff)
parentf2984000823abd21a4c5a157a08ec28a3ddf0a4a (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 $?