#!/bin/sh

if [ -z "$APRS4R_ROOT" ]; then
  APRS4R_ROOT=""
fi

if [ -f $APRS4R_ROOT/etc/default/aprs4r ] ; then 
  . $APRS4R_ROOT/etc/default/aprs4r
fi

if [ -z "$APRS4R_ETC" ]; then
  APRS4R_ETC=/etc/aprs4r
fi

if [ -z "$APRS4R_LIB" ]; then
  APRS4R_LIB=/usr/lib/ruby/1.8
fi

if [ -z "$APRS4R_LOG" ]; then
  APRS4R_LOG=/var/log/aprs4r
fi

if [ -z "$APRS4R_PROFILE" ]; then
  APRS4R_PROFILE="$APRS4R_ETC/$PROFILE"
fi

/bin/mkdir -p $APRS4R_LOG

/usr/bin/ruby $APRS4R_LIB/aprs4r.rb $APRS4R_PROFILE > $APRS4R_LOG/aprs4r-stdout.log 2> $APRS4R_LOG/aprs4r-stderr.log & 
