#!/bin/sh

if [ -f /etc/default/aprs4r ]; then
  . /etc/default/aprs4r
else
  ENABLE="false"
fi

# if not enabled then exit now
if [ "$ENABLE" != "true" ]; then
  echo "APRS4R disabled"
  exit 0 
fi

FILE=/etc/aprs4r/$PROFILE

if [ ! -f $FILE ]; then 
  echo "configuration file $FILE not found"
  exit 1
fi

PATH=/sbin:/usr/bin

case $1 in

    start)
	/usr/bin/aprs4r $FILE

	;;

    stop)
	echo "NOT IMPLEMENTED YET..."

	;;

    restart)
	echo "NOT IMPLEMENTED YET..."

	;;

    status)
	echo "NOT IMPLEMENTED YET..."

	;;

    *)
	echo "Usage: $0 {start|stop|restart|status}"

	;;

esac
