#!/bin/sh # $FreeBSD: head/net/serviio/files/serviio.in 371092 2014-10-18 06:28:39Z netchild $ # # PROVIDE: serviio # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following line to /etc/rc.conf[.local] to enable serviio: # # serviio_enable="YES" . /etc/rc.subr name=serviio rcvar=serviio_enable command=%%PREFIX%%/sbin/serviiod load_rc_config $name : ${serviio_user="dlna"} if [ -n "${serviio_lang}" ]; then export LANG=${serviio_lang} fi _dirs="/var/db/serviio /var/db/serviio/home /var/log/serviio" start_precmd="mkdir -p $_dirs; chown $serviio_user $_dirs" command_args="$serviio_args &" stop_cmd="$command -stop" status_cmd=${name}_status serviio_status() { serviio_pid=$(ps -wwwaU ${serviio_user} | awk '/java.*org.serviio.MediaServer/ {print $1}') if [ -n "${serviio_pid}" ]; then echo "${name} is running as pid ${serviio_pid}" else echo "${name} is not running" return 1 fi } run_rc_command $1