3 # $NetBSD: gmediaserver.sh,v 1.2 2013/02/16 15:10:46 tron Exp $
5 # PROVIDE: gmediaserver
12 command="@PREFIX@/bin/${name}"
13 pidfile
="@VARBASE@/gmediaserver/${name}.pid"
14 command_flags
="-b --pid-file=${pidfile} -o @VARBASE@/${name}/${name}.log"
15 required_files
="@CFGFILE@"
16 start_cmd
="gmediaserver_start"
17 extra_commands
="rescan"
18 rescan_cmd
="gmediaserver_rescan"
22 directories
=/nonexistent
24 if [ -f "@CFGFILE@" ]; then
27 @ECHO@
"Starting ${name}."
28 @SU@ @GMEDIA_USER@
-c "$command $command_flags $options $directories"
33 if [ -f "${pidfile}" ] ; then
34 @ECHO@
"Signalling ${name} to rescan directories."
35 kill -USR1 `@CAT@ "${pidfile}"`
39 if [ -f /etc
/rc.subr
-a -f /etc
/rc.conf
-a -f /etc
/rc.d
/DAEMON
]; then
40 load_rc_config
${name}
43 if [ -f /etc
/rc.conf
]; then
52 if [ -f "${pidfile}" ] ; then
53 @ECHO@
"Stopping ${name}."
54 kill `@CAT@ "${pidfile}"`
56 @ECHO@
"${name} not running?"
71 @ECHO@
"Usage: $0 {start|stop|restart|rescan}" 1>&2