myusername=`whoami`
if [ $myusername != 'root' ]
then
  echo "You should probably run with sudo"
  exit 1
else
  echo "running as root"
fi

#get name of serial device
if [ $# -ge 1 ]
then
  ser1=$1
else
  ser1=/dev/ttyUSB0
fi
echo "using $ser1 as serial port"

python kiss_on.py $ser1
if [ $? -ne 0 ]
then
  echo "ERROR: Setting KISS mode failed"
  exit 1
fi

kissattach $ser1 radio1 192.168.3.10
if [ $? -ne 0 ]
then
  echo "ERROR: kissattach failed"
  exit 1
fi

axparms -route add radio1 default
if [ $? -ne 0 ]
then
  echo "ERROR: axparms failed"
  exit 1
fi

ax25d
if [ $? -ne 0 ]
then
  echo "ERROR: ax25d did not start correctly"
  exit 1
fi



