#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

PNAME=svxlink
NAME="SvxLink Server"
DAEMON=/usr/bin/$PNAME

POPTS="--daemon \
	${RUNASUSER:+--runasuser=$RUNASUSER} \
	${PIDFILE:+--pidfile=$PIDFILE} \
	${LOGFILE:+--logfile=$LOGFILE} \
	${CFGFILE:+--config=$CFGFILE}"

create_logfile()
{
  touch $LOGFILE
  if [ -n "$RUNASUSER" ]; then
    chown $RUNASUSER.$RUNASUSER $LOGFILE
  fi
}


depend() {
  need localmount
  use net
  after bootmisc
}

start() {
  ebegin "Starting $NAME"
  create_logfile
  export $ENV
  start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON -- $POPTS
  eend $?
}

#stop() {

#}

#restart() {

#}
