diff options
author | bsam <bsam@FreeBSD.org> | 2011-07-06 22:34:00 +0800 |
---|---|---|
committer | bsam <bsam@FreeBSD.org> | 2011-07-06 22:34:00 +0800 |
commit | f903dd37468fccd9b4079e0f314323b93d5a43a3 (patch) | |
tree | 351f88e415d09923e7e96e63f47766207f84334f /multimedia/zoneminder | |
parent | 81994857e2bf2378be5db3b2edd2584b13b23d08 (diff) | |
download | freebsd-ports-gnome-f903dd37468fccd9b4079e0f314323b93d5a43a3.tar.gz freebsd-ports-gnome-f903dd37468fccd9b4079e0f314323b93d5a43a3.tar.zst freebsd-ports-gnome-f903dd37468fccd9b4079e0f314323b93d5a43a3.zip |
Rework rc script:
. name="zoneminder";
. do load_rc_config at a proper location and remove a second one;
. some whitespace refinement;
. do a 10 seconds pause only at system startup.
Do not bump PORTREVISION for now, it'll be done when the file is renamed.
Submitted by: dougb
Diffstat (limited to 'multimedia/zoneminder')
-rw-r--r-- | multimedia/zoneminder/files/zm.in | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/multimedia/zoneminder/files/zm.in b/multimedia/zoneminder/files/zm.in index 0956c65662e4..5d17c317077b 100644 --- a/multimedia/zoneminder/files/zm.in +++ b/multimedia/zoneminder/files/zm.in @@ -1,44 +1,40 @@ #!/bin/sh # $FreeBSD$ - +# # PROVIDE: zoneminder # REQUIRE: mysql apache # KEYWORD: shutdown - +# # Add the following line to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # -# zm_enable (bool): Set to NO by default. -# Set it to YES to enable zoneminder. -# +# zoneminder_enable (bool): Set to NO by default. +# Set it to YES to enable zoneminder. . /etc/rc.subr -name="zm" +name="zoneminder" rcvar=${name}_enable -command=%%PREFIX%%/bin/${name}pkg.pl -command_args="$1" -pidfile=/var/run/${name}/${name}.pid - load_rc_config "$name" -: ${zm_enable="NO"} +: ${zoneminder_enable="NO"} + +command=%%PREFIX%%/bin/zmpkg.pl +command_args="$1" +pidfile=/var/run/zm/zm.pid stop_cmd="zm_stop" status_cmd="zm_status" -load_rc_config "$name" -: ${zm_enable="NO"} - zm_stop() { ${command} ${command_args} } -zm_status() ( - %%PREFIX%%/bin/${name}dc.pl status -) +zm_status() { + %%PREFIX%%/bin/zmdc.pl status +} -sleep 10 +[ "${command_args}" = "faststart" ] && echo -n "zoneminder: 10 seconds pause..." && sleep 10 && echo " done" run_rc_command "$1" |