initial import
This commit is contained in:
34
gerbera-legacy/gerbera.initd
Normal file
34
gerbera-legacy/gerbera.initd
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
name="Gerbera"
|
||||
configfile="${CONFIG:-/etc/gerbera/config.xml}"
|
||||
start_stop_daemon_args="--user ${G_USER:-gerbera} --group ${G_GROUP:-gerbera}"
|
||||
pidfile="/run/gerbera/gerbera.pid"
|
||||
command=/usr/bin/gerbera
|
||||
command_args="-c $configfile -l /var/log/gerbera/gerbera.log"
|
||||
command_background=true
|
||||
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
if ! [ -f "${configfile}" ]; then
|
||||
/usr/bin/gerbera --create-config > "${configfile}"
|
||||
fi
|
||||
if yesno "${DEBUG}"; then
|
||||
command_args="$command_args -D"
|
||||
fi
|
||||
if [ ! -z "${BIND_INTERFACE}" ]; then
|
||||
command_args="$command_args -e ${BIND_INTERFACE}"
|
||||
fi
|
||||
if [ ! -z "${BIND_PORT}" ]; then
|
||||
command_args="$command_args -p ${BIND_PORT}"
|
||||
fi
|
||||
if [ ! -z "${BIND_IP}" ]; then
|
||||
command_args="$command_args -i ${BIND_IP}"
|
||||
fi
|
||||
|
||||
checkpath --owner ${G_USER:-gerbera}:${G_GROUP:-gerbera} \
|
||||
--directory ${pidfile%/*}
|
||||
}
|
||||
Reference in New Issue
Block a user