2006-10-04 20:57:49 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
2007-05-10 10:38:53 +00:00
|
|
|
START=50
|
2006-08-02 08:07:18 +00:00
|
|
|
|
|
|
|
BIN=gmediaserver
|
|
|
|
DEFAULT=/etc/default/$BIN
|
|
|
|
RUN_D=/var/run
|
|
|
|
PID_F=$RUN_D/$BIN.pid
|
|
|
|
|
2006-10-04 20:57:49 +00:00
|
|
|
start() {
|
2007-09-18 17:08:11 +00:00
|
|
|
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}
|
2006-10-04 20:57:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
|
|
|
[ -f $PID_F ] && kill $(cat $PID_F)
|
|
|
|
}
|
2006-08-02 08:07:18 +00:00
|
|
|
|