diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2014-03-29 18:24:43 +0200 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2014-03-29 18:24:43 +0200 |
commit | edddef76929610ef416c68062c5fc4fa9171bb6a (patch) | |
tree | 50b965c3f4ab1c0bf5f78e768a30e40aa961a9f2 /main/zoneminder/zoneminder.initd | |
parent | 176c6d0b61c7d337402634e3ab433ec6e244ae4d (diff) | |
download | aports-edddef76929610ef416c68062c5fc4fa9171bb6a.tar.bz2 aports-edddef76929610ef416c68062c5fc4fa9171bb6a.tar.xz |
main/zoneminder: moved from testing
Diffstat (limited to 'main/zoneminder/zoneminder.initd')
-rw-r--r-- | main/zoneminder/zoneminder.initd | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/main/zoneminder/zoneminder.initd b/main/zoneminder/zoneminder.initd new file mode 100644 index 0000000000..ce600fdb54 --- /dev/null +++ b/main/zoneminder/zoneminder.initd @@ -0,0 +1,47 @@ +#!/sbin/runscript + +# init.d file for zoneminder +# Copyright (c) 2013 Kaarle Ritvanen + +name=zoneminder +command=/usr/bin/zmpkg.pl +extra_commands=setup + +depend() { + need apache2 + after mysql +} + +start() { + ebegin "Starting $name" + if status > /dev/null; then + ewarn "$name already started" + else + $command start + fi + eend $? +} + +stop() { + ebegin "Stopping $name" + if status > /dev/null; then + $command stop + else + ewarn "$name already stopped" + fi + eend $? +} + +status() { + status=$($command status) + echo $status + [ "$status" = running ] +} + +setup() { + . /etc/zm.conf + ebegin "Initializing $name database" + mysql -h $ZM_DB_HOST -u $ZM_DB_USER -p$ZM_DB_PASS \ + < $ZM_PATH_DATA/db/zm_create.sql + eend $? +} |