packages/net/gmediaserver/files/gmediaserver.init
olli 600de8d582 gmediaserver: migrate configuration to UCI
git-svn-id: svn://svn.openwrt.org/openwrt/packages@8834 3c298f89-4303-0410-b956-a3cf2f4a3e73
2007-09-18 17:08:11 +00:00

28 lines
534 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org
START=50
BIN=gmediaserver
DEFAULT=/etc/default/$BIN
RUN_D=/var/run
PID_F=$RUN_D/$BIN.pid
start() {
mkdir -p $RUN_D
config_load gmediaserver
config_foreach start_service gmediaserver
}
start_service() {
local cfg="$1"
config_get content_directory "$cfg" content_directory
config_get interface "$cfg" interface
$BIN --background --interface=${interface:-br-lan} --pid-file=$PID_F ${content_directory:-/tmp}
}
stop() {
[ -f $PID_F ] && kill $(cat $PID_F)
}