diff options
Diffstat (limited to 'community/gerbera/gerbera.initd')
-rw-r--r-- | community/gerbera/gerbera.initd | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/community/gerbera/gerbera.initd b/community/gerbera/gerbera.initd new file mode 100644 index 0000000000..8356a0a212 --- /dev/null +++ b/community/gerbera/gerbera.initd | |||
@@ -0,0 +1,34 @@ | |||
1 | #!/sbin/openrc-run | ||
2 | |||
3 | name="Gerbera" | ||
4 | configfile="${CONFIG:-/etc/gerbera/config.xml}" | ||
5 | start_stop_daemon_args="--user ${G_USER:-gerbera} --group ${j_GROUP:-gerbera}" | ||
6 | pidfile="/run/gerbera/gerbera.pid" | ||
7 | command=/usr/bin/gerbera | ||
8 | command_args="-c $configfile -l /var/log/gerbera/gerbera.log" | ||
9 | command_background=true | ||
10 | |||
11 | depend() { | ||
12 | need net | ||
13 | } | ||
14 | |||
15 | start_pre() { | ||
16 | if ! [ -f "${configfile}" ]; then | ||
17 | /usr/sbin/gerbera --create-config > "${configfile}" | ||
18 | fi | ||
19 | if yesno "${DEBUG}"; then | ||
20 | command_args="$command_args -D" | ||
21 | fi | ||
22 | if [ ! -z "${BIND_INTERFACE}" ]; then | ||
23 | command_args="$command_args -e ${BIND_INTERFACE}" | ||
24 | fi | ||
25 | if [ ! -z "${BIND_PORT}" ]; then | ||
26 | command_args="$command_args -p ${BIND_PORT}" | ||
27 | fi | ||
28 | if [ ! -z "${BIND_IP}" ]; then | ||
29 | command_args="$command_args -i ${BIND_IP}" | ||
30 | fi | ||
31 | |||
32 | checkpath --owner ${G_USER:-gerbera}:${G_GROUP:-gerbera} \ | ||
33 | --directory ${pidfile%/*} | ||
34 | } | ||