#!/bin/bash ######################################################## # # # A simple wrapper script to permit UI 'conversations'# # using native linux ax25 -- it ain't pretty but it # # woiks! # # # # Free for any use, you can put this where you want # # # # Written by KC2RGW # # 02.27.2010 # # Version .02 # # # ######################################################## # set a sane path PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin # path to your beacon command BEACON=`which beacon` # path to your axlisten command LISTEN=`which axlisten` if [ "$1" = "" ] ; then cat<<-EOF $0 USAGE: $0 DESCRIPTION: This script wraps axlisten in shell to 'converse' in UI mode This will likely have to be run via sudo for device access For Unproto put something like CQ or the name of a net For Digipath put whatever path of digis you like or leave it blank EOF exit else PORT="$1" fi # Can we get to the applications to run? if [ ! -x $BEACON ] ; then echo "Cannot find your beacon command $BEACON" echo "Check your path and permissions or edit $0" exit fi if [ ! -x $LISTEN ] ; then echo "Cannot find your axlisten command $LISTEN" echo "Check your path and permissions or edit $0" exit fi # Prompt and get the unproto path and any digis echo -n "Unproto to: " read UNPROTO echo -n "Digi via: " read DIGIPATH # If the digi path is blank, skip it, otherwise construct it if [ "$DIGIPATH" = "" ] ; then DEST=$UNPROTO else DEST="$UNPROTO $DIGIPATH" fi # Fire up axlisten for the session $LISTEN -tr & echo echo "Started axlisten, if using a digi" echo "your own packets should echo back" echo echo "ctrl-c quits" AXPID="$!" trap 'kill $AXPID; echo "Killing axlisten and quitting!"; exit' INT TERM while [ 0 ]; do echo # local prompt TIME=`date +%T` echo -n "$TIME $UNPROTO-> " read INPUT if [ $? == 1 ]; then break; fi # The ugly hack, just blast out a directed beacon $BEACON -d "$DEST" -s "$PORT" "$INPUT" done