1
0
mirror of https://github.com/km4ack/patmenu2.git synced 2025-05-16 14:50:13 -07:00

Merge pull request #64 from km4ack/dev

Dev
This commit is contained in:
KM4ACK 2022-09-30 08:18:19 -05:00 committed by GitHub
commit 4796233781
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 661 additions and 41 deletions

View File

@ -18,6 +18,7 @@ TODAY=$(date)
#path where files are located #path where files are located
#must match path in findardop script #must match path in findardop script
MYPATH=$HOME/patmenu2/ardop-list/ MYPATH=$HOME/patmenu2/ardop-list/
MYVARA=$HOME/patmenu2/vara-list/
#my log file #my log file
LOG=$HOME/Documents/mylog.txt LOG=$HOME/Documents/mylog.txt
@ -43,8 +44,9 @@ echo "GRID=$GRID" > $HOME/patmenu2/.grid
#make directory if it doesn't exist #make directory if it doesn't exist
mkdir -p $MYPATH mkdir -p $MYPATH
mkdir -p $MYVARA
#set variables for each list #set variables for each ARDOP list
FILE=$MYPATH'ardoplist.txt' FILE=$MYPATH'ardoplist.txt'
EIGHTY=$MYPATH'80mardoplist.txt' EIGHTY=$MYPATH'80mardoplist.txt'
FORTY=$MYPATH'40mardoplist.txt' FORTY=$MYPATH'40mardoplist.txt'
@ -52,6 +54,13 @@ TWENTY=$MYPATH'20mardoplist.txt'
THIRTY=$MYPATH'30mardoplist.txt' THIRTY=$MYPATH'30mardoplist.txt'
PACKET=$MYPATH'packet.txt' PACKET=$MYPATH'packet.txt'
#set variables for each vara list
VARAFILE=$MYVARA'varalist.txt'
VARAEIGHTY=$MYVARA'80mvaralist.txt'
VARAFORTY=$MYVARA'40mvaralist.txt'
VARATWENTY=$MYVARA'20mvaralist.txt'
VARATHIRTY=$MYVARA'30mvaralist.txt'
VARAFM=$MYVARA'varafm.txt'
#check internet connection #check internet connection
echo "Please wait while we check your internet connection" echo "Please wait while we check your internet connection"
@ -79,7 +88,33 @@ else
echo "Internet connection detected" echo "Internet connection detected"
fi fi
#remove old files before downloading new ones
#remove old vara files before downloading new ones
if [ -f $VARATHIRTY ]; then
rm $VARATHIRTY
fi
if [ -f $VARAFILE ]; then
rm $VARAFILE
fi
if [ -f $VARAEIGHTY ]; then
rm $VARAEIGHTY
fi
if [ -f $VARAFORTY ]; then
rm $VARAFORTY
fi
if [ -f $VARATWENTY ]; then
rm $VARATWENTY
fi
if [ -f $VARAFM ]; then
rm $VARAFM
fi
#remove old ARDOP files before downloading new ones
if [ -f $THIRTY ]; then if [ -f $THIRTY ]; then
rm $THIRTY rm $THIRTY
fi fi
@ -118,6 +153,13 @@ pat rmslist -s --band 40m --mode ardop --force-download >> $FORTY
pat rmslist -s --band 20m --mode ardop --force-download >> $TWENTY pat rmslist -s --band 20m --mode ardop --force-download >> $TWENTY
pat rmslist -s --band 30m --mode ardop --force-download >> $THIRTY pat rmslist -s --band 30m --mode ardop --force-download >> $THIRTY
pat rmslist -s --mode packet --force-download >> $PACKET pat rmslist -s --mode packet --force-download >> $PACKET
pat rmslist -s --mode vara --force-download >> $VARAFILE
pat rmslist -s --band 80m --mode vara --force-download >> $VARAEIGHTY
pat rmslist -s --band 40m --mode vara --force-download >> $VARAFORTY
pat rmslist -s --band 20m --mode vara --force-download >> $VARATWENTY
pat rmslist -s --band 30m --mode vara --force-download >> $VARATHIRTY
pat rmslist -s --band 2m --mode varafm --force-download >> $VARAFM
} }
DL DL

View File

@ -95,6 +95,7 @@ OUTFILE=/run/user/$UID/tempardoplist.txt
CONFIG=$XDG_CONFIG_HOME/pat/config.json CONFIG=$XDG_CONFIG_HOME/pat/config.json
TEMP=/run/user/$UID/tempconfig.txt TEMP=/run/user/$UID/tempconfig.txt
ARDOPLIST=$MYPATH/ardop-list ARDOPLIST=$MYPATH/ardop-list
VARALIST=$MYPATH/vara-list
WHO=$(whoami) WHO=$(whoami)
source $MYPATH/config #patmenu config file source $MYPATH/config #patmenu config file
#check to make sure user has downloaded #check to make sure user has downloaded
@ -118,14 +119,16 @@ BANDS="20|30|40|80|2M-70CM"
SEARCH=$(yad --form --width=400 --text="<b>Find Winlink Gateways</b>" --text-align=center --center --title="Find ARDOP" --text-align=center \ SEARCH=$(yad --form --width=400 --text="<b>Find Winlink Gateways</b>" --text-align=center --center --title="Find ARDOP" --text-align=center \
--separator="|" --item-separator="|" \ --separator="|" --item-separator="|" \
--image=$LOGO --window-icon=$LOGO --image-on-top \ --image=$LOGO --window-icon=$LOGO --image-on-top \
--field="Choose Modem":CB "VARA|ARDOP" \
--field="Grid to Search" "EM" \ --field="Grid to Search" "EM" \
--field="Band to Search":CB "$BANDS" \ --field="Band to Search":CB "$BANDS" \
--button="Search":2 \ --button="Search":2 \
--button="Cancel":1) --button="Cancel":1)
QUIT=$? QUIT=$?
GRID=$(echo $SEARCH | awk -F "|" '{print $1}') MODEM=$(echo $SEARCH | awk -F "|" '{print $1}')
GRID=$(echo $SEARCH | awk -F "|" '{print $2}')
GRID=$(echo "${GRID^^}") GRID=$(echo "${GRID^^}")
BAND=$(echo $SEARCH | awk -F "|" '{print $2}') BAND=$(echo $SEARCH | awk -F "|" '{print $3}')
echo "Grid search is $GRID" echo "Grid search is $GRID"
echo "Band is $BAND" echo "Band is $BAND"
@ -141,7 +144,7 @@ fi
if [ $QUIT = 2 ] && [ "$BAND" = '2M-70CM' ]; then if [ $QUIT = 2 ] && [ "$BAND" = '2M-70CM' ]; then
#########START TEST SECTION###################### #########START PACKET SECTION######################
FILE=$MYPATH/ardop-list/packet.txt FILE=$MYPATH/ardop-list/packet.txt
@ -168,6 +171,7 @@ yad --title="Search Results" --width=1100 --height=500 \
--button="Add Alias":2 > $MYTEMP) --button="Add Alias":2 > $MYTEMP)
BUT=$? BUT=$?
if [ "$BUT" = 2 ];then if [ "$BUT" = 2 ];then
CALL=$(echo $INFO | awk -F "|" '{print $1}') CALL=$(echo $INFO | awk -F "|" '{print $1}')
SC=$(echo $INFO | awk -F "|" '{print $9}') SC=$(echo $INFO | awk -F "|" '{print $9}')
@ -193,10 +197,6 @@ done < $TEMP2
sudo killall pat sudo killall pat
sudo systemctl start pat@$WHO sudo systemctl start pat@$WHO
##############END TEST SECTION################
yad --title="ADDED" --width=300 --height=100 \ yad --title="ADDED" --width=300 --height=100 \
--image $LOGO --window-icon=$LOGO --image-on-top \ --image $LOGO --window-icon=$LOGO --image-on-top \
--center --form --text="$CALL-$FREQ added to Pat Winlink\rRefresh Pat Mailbox Window\rto view changes" \ --center --form --text="$CALL-$FREQ added to Pat Winlink\rRefresh Pat Mailbox Window\rto view changes" \
@ -205,6 +205,10 @@ SEARCHMENU
fi fi
SEARCHMENU SEARCHMENU
fi fi
##############END PACKET SECTION################
#determine which modem was chosen
if [ "$MODEM" = 'ARDOP' ]; then
#############ARDOP SEARCH#################### #############ARDOP SEARCH####################
@ -213,16 +217,19 @@ OUTFILE2=/run/user/$UID/tempardop2.txt
if [ $BAND = 20 ];then if [ $BAND = 20 ];then
FILE=$ARDOPLIST/20mardoplist.txt FILE=$ARDOPLIST/20mardoplist.txt
cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1 cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1
#cat $OUTFILE | tr -s '[:space:]' | sed 's/ /|/g'| sed 's/[A-Za-z]*$/|/g' > $OUTFILE2 sed -i 's/&/&amp;/g' $OUTFILE > /dev/null 2>&1
elif [ $BAND = 30 ];then elif [ $BAND = 30 ];then
FILE=$ARDOPLIST/30mardoplist.txt FILE=$ARDOPLIST/30mardoplist.txt
cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1 cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1
sed -i 's/&/&amp;/g' $OUTFILE > /dev/null 2>&1
elif [ $BAND = 40 ];then elif [ $BAND = 40 ];then
FILE=$ARDOPLIST/40mardoplist.txt FILE=$ARDOPLIST/40mardoplist.txt
cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1 cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1
sed -i 's/&/&amp;/g' $OUTFILE > /dev/null 2>&1
elif [ $BAND = 80 ];then elif [ $BAND = 80 ];then
FILE=$ARDOPLIST/80mardoplist.txt FILE=$ARDOPLIST/80mardoplist.txt
cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1 cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1
sed -i 's/&/&amp;/g' $OUTFILE > /dev/null 2>&1
echo "80 done" echo "80 done"
fi fi
@ -249,12 +256,12 @@ FREQ=$(echo $SC | sed 's/.*=//')
while read LINE; do while read LINE; do
CALL=$(echo $LINE | awk -F "|" '{print $1}') CALL=$(echo $LINE | awk -F "|" '{print $1}')
SC=$(echo $LINE | awk -F "|" '{print $9}') SC=$(echo $LINE | awk -F "|" '{print $9}' | sed 's/\&amp;/\&/')
FREQ=$(echo $SC | sed 's/.*=//') FREQ=$(echo $SC | sed 's/.*=//')
if [ $RIGCONTROL = 'no' ]; then if [ $RIGCONTROL = 'no' ]; then
SC=$(echo $SC | sed 's/[?].*$//') SC=$(echo $SC | sed 's/[?].*$//')
fi fi
jq '.connect_aliases += {'\""$CALL-$BAND"M"-$FREQ"\"' : '\"$SC\"'}' $CONFIG > $TEMP jq '.connect_aliases += {'\""$CALL-$BAND"M"-""ARDOP"\"' : '\"$SC\"'}' $CONFIG > $TEMP
cp $TEMP $CONFIG cp $TEMP $CONFIG
rm $TEMP rm $TEMP
done < /run/user/$UID/mytemptestardoplist done < /run/user/$UID/mytemptestardoplist
@ -277,6 +284,97 @@ yad --title="ADDED" --width=300 --height=100 \
SEARCHMENU SEARCHMENU
fi fi
elif [ "$MODEM" = 'VARA' ]; then
#############VARA SEARCH####################
OUTFILE2=/run/user/$UID/tempardop2.txt
if [ $BAND = 20 ];then
FILE=$VARALIST/20mvaralist.txt
cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1
sed -i 's/&/&amp;/g' $OUTFILE > /dev/null 2>&1
elif [ $BAND = 30 ];then
FILE=$VARALIST/30mvaralist.txt
cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1
sed -i 's/&/&amp;/g' $OUTFILE > /dev/null 2>&1
elif [ $BAND = 40 ];then
FILE=$VARALIST/40mvaralist.txt
cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1
sed -i 's/&/&amp;/g' $OUTFILE > /dev/null 2>&1
elif [ $BAND = 80 ];then
FILE=$VARALIST/80mvaralist.txt
cat $FILE | egrep -i $GRID[[:digit:]]{2} | tee "$OUTFILE" > /dev/null 2>&1
sed -i 's/&/&amp;/g' $OUTFILE > /dev/null 2>&1
echo "80 done"
fi
#remove outfile2 if it exist
if [ -f $OUTFILE2 ]; then
rm $OUTFILE2
fi
#add speed to line if not in list already
while read -r line
do
CHECK=$(echo $line | awk '{print $6}')
if [ "$CHECK" = 500 ] || [ "$CHECK" = 2750 ]; then
echo $line >> $OUTFILE2
else
echo $line | sed 's/VARA/VARA 500/' >> $OUTFILE2
fi
done < $OUTFILE
INFO=$(PARSER='OFS="\n" {print $1, $2, $3, $4, $5, $6, $7, $9, $11}'
MYTEMP=/run/user/$UID/mytemptestardoplist
tail -50 $OUTFILE2 | awk "$PARSER" | \
yad --title="Search Results" --width=1100 --height=500 \
--image $LOGO --window-icon=$LOGO --image-on-top --multiple \
--center --list --text="Search Results" \
--column Call --column Grid --column Dist \
--column Azm --column Mode --column Speed \
--column Dial-Freq \
--column Center-Freq --column Shortcut \
--button=gtk-close \
--button="Add Alias":2 > $MYTEMP)
BUT=$?
if [ "$BUT" = 2 ];then
CALL=$(echo $INFO | awk -F "|" '{print $1}')
SC=$(echo $INFO | awk -F "|" '{print $9}')
FREQ=$(echo $SC | sed 's/.*=//')
if [ $RIGCONTROL = 'no' ]; then
SC=$(echo $SC | sed 's/[?].*$//')
fi
while read LINE; do
CALL=$(echo $LINE | awk -F "|" '{print $1}')
SC=$(echo $LINE | awk -F "|" '{print $9}' | sed 's/\&amp;/\&/')
FREQ=$(echo $SC | sed 's/.*=//')
if [ $RIGCONTROL = 'no' ]; then
SC=$(echo $SC | sed 's/[?].*$//')
fi
jq '.connect_aliases += {'\""$CALL-$BAND"M"-""VARA"\"' : '\"$SC\"'}' $CONFIG > $TEMP
cp $TEMP $CONFIG
rm $TEMP
done < /run/user/$UID/mytemptestardoplist
sudo killall pat
sudo systemctl start pat@$WHO
if [ -z "$CALL" ]; then
yad --title="No Selection" --width=300 --height=100 \
--image $LOGO --window-icon=$LOGO --image-on-top \
--center --form --text="No station was selected\r Please try again" \
--button=gtk-ok
$MAIN &
exit
fi
yad --title="ADDED" --width=300 --height=100 \
--image $LOGO --window-icon=$LOGO --image-on-top \
--center --form --text="Alias added to Pat Winlink\rRefresh Pat Mailbox Window\rto view changes" \
--button=gtk-ok
SEARCHMENU
fi
fi #close modem if/then statement
SEARCHMENU SEARCHMENU
} }
SEARCHMENU SEARCHMENU
@ -436,12 +534,17 @@ TMPFILE2=$DIR/tempfile2
TMPFILE3=$DIR/tempfile3 TMPFILE3=$DIR/tempfile3
MYGRID=$(cat /run/user/$UID/gridinfo.txt | cut -c1-6) MYGRID=$(cat /run/user/$UID/gridinfo.txt | cut -c1-6)
#backup current lists #backup current ARDOP lists
BKDIR=$MYPATH/ardop-list/bkup-`date +%F.%H%M` BKDIR=$MYPATH/ardop-list/bkup-`date +%F.%H%M`
mkdir -p $BKDIR mkdir -p $BKDIR
cp -r $HOME/patmenu2/ardop-list/*.txt $BKDIR/ cp -r $HOME/patmenu2/ardop-list/*.txt $BKDIR/
MYGRID=$(yad --form --width=450 --text="<b>Recalculate Distance and Bearings to Gateways</b>\rThis takes 2-3 minutes to complete" \ #backup current VARA lists
BKDIRVARA=$MYPATH/vara-list/bkup-`date +%F.%H%M`
mkdir -p $BKDIRVARA
cp -r $HOME/patmenu2/vara-list/*.txt $BKDIRVARA/
MYGRID=$(yad --form --width=450 --text="<b>Recalculate Distance and Bearings to Gateways</b>\rThis takes 5-6 minutes to complete" \
--text-align=center --center --title="Recalculate" --text-align=center --separator="|" --item-separator="|" \ --text-align=center --center --title="Recalculate" --text-align=center --separator="|" --item-separator="|" \
--image=$LOGO --window-icon=$LOGO --image-on-top \ --image=$LOGO --window-icon=$LOGO --image-on-top \
--field="Current Grid Square" "$MYGRID" \ --field="Current Grid Square" "$MYGRID" \
@ -463,30 +566,47 @@ echo "GRID=$MYGRID" > $HOME/patmenu2/ardop-list/grid.txt
echo "LASTDL=Recalculated `date`" >> $HOME/patmenu2/ardop-list/grid.txt echo "LASTDL=Recalculated `date`" >> $HOME/patmenu2/ardop-list/grid.txt
MAIN(){ MAIN(){
echo "Recalculating 20M List" echo "Recalculating ARDOP 20M List"
RECALC 20mardoplist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \ RECALC 20mardoplist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \
--text="Recalculating 20M List\r<b>DO NOT CLOSE THIS WINDOW</b>\rDoing so will abort the process\rand leave you with a corrupt list." --text="Recalculating ARDOP 20M List\r<b>DO NOT CLOSE THIS WINDOW</b>\rDoing so will abort the process\rand leave you with a corrupt list."
echo "Recalculating 30M List" echo "Recalculating ARDOP 30M List"
RECALC 30mardoplist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \ RECALC 30mardoplist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \
--text="Recalculating 30M List\r<b>DO NOT CLOSE THIS WINDOW</b>\rDoing so will abort the process\rand leave you with a corrupt list." --text="Recalculating ARDOP 30M List\r<b>DO NOT CLOSE THIS WINDOW</b>\rDoing so will abort the process\rand leave you with a corrupt list."
echo "Recalculating 40M List" echo "Recalculating ARDOP 40M List"
RECALC 40mardoplist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \ RECALC 40mardoplist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \
--text="Recalculating 40M List\r<b>DO NOT CLOSE THIS WINDOW</b>\rDoing so will abort the process\rand leave you with a corrupt list." --text="Recalculating ARDOP 40M List\r<b>DO NOT CLOSE THIS WINDOW</b>\rDoing so will abort the process\rand leave you with a corrupt list."
echo "Recalculating 80M List" echo "Recalculating ARDOP 80M List"
RECALC 80mardoplist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \ RECALC 80mardoplist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \
--text="Recalculating 80M List\r<b>DO NOT CLOSE THIS WINDOW</b>\rDoing so will abort the process\rand leave you with a corrupt list." --text="Recalculating ARDOP 80M List\r<b>DO NOT CLOSE THIS WINDOW</b>\rDoing so will abort the process\rand leave you with a corrupt list."
echo "Recalculating Packet list" echo "Recalculating Packet list"
RECALC packet.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \ RECALC packet.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \
--text="Recalculating Packet List\r<b>DO NOT CLOSE THIS WINDOW</b>\rDoing so will abort the process\rand leave you with a corrupt list." --text="Recalculating Packet List\r<b>DO NOT CLOSE THIS WINDOW</b>\rDoing so will abort the process\rand leave you with a corrupt list."
echo "Recalculating Vara 20M List"
RECALCVARA 20mvaralist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \
--text="Recalculating VARA 20M List\r<b>DO NOT CLOSE THIS WINDOW</b>\rDoing so will abort the process\rand leave you with a corrupt list."
echo "Recalculating Vara 30M List"
RECALCVARA 30mvaralist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \
--text="Recalculating VARA 30M List\r<b>DO NOT CLOSE THIS WINDOW</b>\rDoing so will abort the process\rand leave you with a corrupt list."
echo "Recalculating Vara 40M List"
RECALCVARA 40mvaralist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \
--text="Recalculating VARA 40M List\r<b>DO NOT CLOSE THIS WINDOW</b>\rDoing so will abort the process\rand leave you with a corrupt list."
echo "Recalculating Vara 80M List"
RECALCVARA 80mvaralist.txt | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center --title="Recalculate" \
--text="Recalculating VARA 80M List\r<b>DO NOT CLOSE THIS WINDOW</b>\rDoing so will abort the process\rand leave you with a corrupt list."
yad --center --timeout=2 --timeout-indicator=top --no-buttons --text="New Calculations Complete" yad --center --timeout=2 --timeout-indicator=top --no-buttons --text="New Calculations Complete"
} }
RECALC(){ RECALC(){
#This section recalculates the ARDOP lists and 2M Packet list
FILE=$HOME/patmenu2/ardop-list/$1 FILE=$HOME/patmenu2/ardop-list/$1
#check for and remove existing temp file #check for and remove existing temp file
if [ -f $TMPFILE3 ]; then if [ -f $TMPFILE3 ]; then
@ -528,6 +648,50 @@ sort -k3 -o $TMPFILE3 $TMPFILE3
cp $TMPFILE3 $HOME/patmenu2/ardop-list/$1 cp $TMPFILE3 $HOME/patmenu2/ardop-list/$1
} }
###########VARA Recalculate#######################
RECALCVARA(){
#This section recalculates the VARA lists.
FILE=$HOME/patmenu2/vara-list/$1
#check for and remove existing temp file
if [ -f $TMPFILE3 ]; then
rm $TMPFILE3
fi
#create temp list to work with and remove headers/blank lines
cp $FILE $TMPFILE
sed -i 's/.*information...//;s/.*succeeded.//;s/.*url//' $TMPFILE
sed -i '/^$/d' $TMPFILE
#read file, calculate new distance, and update
while read LINE;
do
GRID=`echo $LINE | awk '{print $2}' | sed 's/\[//;s/\]//'`
DISTANCE=`echo $LINE | awk '{print $3 }'`
BEARING=`echo $LINE | awk '{print $4 }'`
CALC=`/usr/bin/wwl $MYGRID $GRID`
NEWDISTANCE=`echo $CALC | awk '{print $2}'`
NEWBEARING=`echo $CALC | awk '{print $5}'`
echo $LINE | sed "s/$DISTANCE/$NEWDISTANCE/;s/$BEARING/$NEWBEARING/" >> $TMPFILE2
done < $TMPFILE
rm $TMPFILE
#pad distance with zeros for sorting
while read LINE
do
DISTANCE=$(echo $LINE | awk '{ print $3 }')
NEWDISTANCE=$(echo $LINE | awk '{ print $3 }' | sed -e :a -e 's/^.\{1,4\}$/0&/;ta')
echo $LINE | sed "s/$DISTANCE/$NEWDISTANCE/" >> $TMPFILE3
done < $TMPFILE2
rm $TMPFILE2
#sort list by distance
sort -k3 -o $TMPFILE3 $TMPFILE3
cp $TMPFILE3 $HOME/patmenu2/vara-list/$1
}
#call main function #call main function
MAIN MAIN
#return to pat menu #return to pat menu

245
autopat-vara Executable file
View File

@ -0,0 +1,245 @@
#!/bin/bash
#script to perform auto connects to gateways
#using pat winlink and the vara modem
#20220831 KM4ACK
#Most of this code was copied from the autopat script which does
#the same thing using the ARDOP modem.
MYPATH=$HOME/patmenu2
LOGO=$MYPATH/pmlogo.png
MAIN=$MYPATH/patmenu
source $MYPATH/config
#verify we have rig control
if [ $RIGCONTROL == 'no' ]
then
yad --title="NO RIG CONTROL" --width=400 --height=100 \
--image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
--center --form --text="\r\r\r\rRig Control is needed for auto pat.\rPlease configure rig control and try again." \
--button=gtk-ok
exit
fi
#Check if FLRIG is running if user has it set in config file
if [ "$RIGCONTROL" = 'yes' ]; then
FLRIG=$(echo $RIG | grep "\-m 4")
if [ -z "$FLRIG" ]; then
echo
else
FLRIG=$(pidof flrig)
if [ -z "$FLRIG" ]; then
yad --title="FAILED" --width=400 --height=100 \
--image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
--center --form --text="Please start FLRIG and try again" \
--button=gtk-ok
exit
fi
fi
fi
#clear any temp files from previous runs that might exist
rm -rf $HOME/tempardop > /dev/null
VARALIST=$MYPATH/vara-list/
touch $LOG
DATE=$(date)
STARTRIG () {
#start rigctld & restart pat
PIDCTL=$(pidof rigctld)
WHO=$(whoami)
if [ -z "$PIDCTL" ]
then
CONTROL=$(echo $RIG | sed 's/rigctl/rigctld/')
$CONTROL &
sudo systemctl restart pat@$WHO
fi
}
STARTRIG
if [ -z "$PIDCTL" ]
then
STARTRIG
fi
SETRIG () {
#Set Mode for rigcontrol
$RIG M $MODEHF
}
SETRIG
#Directions Function
directions () {
echo "The script needs two arguments to run."
echo "It needs the distance that you want to try to connect"
echo "and it needs the band you wish to use"
echo "Bands available are 20, 30, 40, & 80"
echo "The first argument is the distance"
echo "and the second is the band. So to try all 40M"
echo "stations in a 300km radius, you would enter"
echo "autopat 300 40"
exit 0
}
#check if distance is empty and give direction
if [ -z "$1" ]
then
directions
fi
#check if band is empty and give direction
if [ -z "$2" ]
then
directions
fi
#Check for min distance
if [ -z "$3" ]
then
MIN=0
else
MIN=$3
fi
#take $2 as band to use
if [ $2 = "20" ]
then
FILE=$VARALIST"20mvaralist.txt"
elif [ $2 = "30" ]
then
FILE=$VARALIST"30mvaralist.txt"
elif [ $2 = "40" ]
then
FILE=$VARALIST"40mvaralist.txt"
elif [ $2 = "80" ]
then
FILE=$VARALIST"80mvaralist.txt"
fi
#Verify we have a list to work with
test -f $FILE
FILERESULT=$(echo $?)
if [ $FILERESULT = "1" ]
then
echo "FILE DOESN'T EXIST."
yad --title="NO LIST" --width=400 --height=100 \
--image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
--center --form --text="\r\r\rNo list has been downloaded. Auto Pat has no data to work with. Please download the gateway list \
and try again" \
--button="Download List":2 \
--button="Cancel":1
BUT=$?
if [ $BUT = 1 ]; then
exit
elif [ $BUT = 2 ]; then
$MYPATH/getardoplist
$MAIN &
exit
fi
fi
if [ $AMRRON = "no" ]
then
#start varaHF modem
echo "Starting VARA-HF modem"
/usr/local/bin/wine $HOME/.wine/drive_c/VARA/VARA.exe > /dev/null 2>&1 &
echo "standby while the modem starts....."
sleep 10 #give vara time to start
fi
#Pat Connection Function
connect () {
pat connect $CALL
#Check if connection was successful
RESULTS=$(echo $?)
if [ $RESULTS = "0" ]
then
echo "A connection was made"
echo $DATE" "$CALL" Success with autopat" >> $LOG
CALL=$(echo "$CALL" | sed 's/&/ /')
yad --title="SUCCESS" --width=300 --height=100 \
--image $LOGO --window-icon=$LOGO --image-on-top \
--center --form --text="<b>Successfully connected!</b>\r$CALL\r\rSee mylog in documents\rdirectory for more details." \
--button=gtk-ok
if [ $AMRRON = "no" ]
then
sudo killall direwolf piardopc kissattach piARDOP_GUI rigctld > /dev/null 2>&1
VARA=$(ps aux | grep wine | grep VARA | head -1 | awk '{print $2}')
kill -9 $VARA > /dev/null 2>&1
VARA=$(ps aux | grep wine | grep VARA | head -1 | awk '{print $2}')
kill -9 $VARA > /dev/null 2>&1
fi
exit 0
fi
}
#create temp dir & manipulate file
mkdir -p $HOME/tempardop/
#cat file, remove first few lines, remove blanks > NEWFILE NAME
cat $FILE | tail -n +5 | grep '[^[:blank:]]' > $HOME/tempardop/tempardop.txt
#add speed to line if not in list already
#otherwise the URL is wrong
while read -r line
do
CHECK=$(echo $line | awk '{print $6}')
if [ "$CHECK" = 500 ] || [ "$CHECK" = 2750 ]; then
echo $line >> $HOME/tempardop/temp.txt
else
echo $line | sed 's/VARA/VARA 500/' >> $HOME/tempardop/temp.txt
fi
done < $HOME/tempardop/tempardop.txt
cp $HOME/tempardop/temp.txt $HOME/tempardop/tempardop.txt
#pad with zeros
while read LINE
do DISTANCE=$(echo $LINE | awk '{ print $3 }' | sed -e :a -e 's/^.\{1,4\}$/0&/;ta')
CALL=$(echo $LINE | awk '{ print $11 }')
echo $DISTANCE" "$CALL >> $HOME/tempardop/tempardop1.txt
done < $HOME/tempardop/tempardop.txt
cat $HOME/tempardop/tempardop1.txt | sort >> $HOME/tempardop/sorted.txt
echo "Will Attempt to Connect to This Station"
#loop through file and find needed station info
while read LINE
do DISTANCE=$(echo $LINE | awk '{ print $1 }')
CALL=$(echo $LINE | awk '{ print $2 }')
if [ $DISTANCE -lt "$1" ] && [ $DISTANCE -gt "$MIN" ]
then
echo "Distance="$DISTANCE " Call="$CALL
#call the connect funtion
connect
fi
done < $HOME/tempardop/sorted.txt
#remove temp directory & files
rm -rf $HOME/tempardop
if [ $AMRRON = "no" ]
then
sudo killall direwolf piardopc kissattach piARDOP_GUI rigctld > /dev/null 2>&1
sudo rfcomm release /dev/rfcomm0 > /dev/null 2>&1
VARA=$(ps aux | grep wine | grep VARA | head -1 | awk '{print $2}')
kill -9 $VARA > /dev/null 2>&1
VARA=$(ps aux | grep wine | grep VARA | head -1 | awk '{print $2}')
kill -9 $VARA > /dev/null 2>&1
fi
yad --title="NO Connection" --width=400 --height=100 \
--image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
--center --form --text="\r\r\r\rNo Winlink connection was made using the criteria you entered." \
--button=gtk-ok

View File

@ -1,6 +1,19 @@
release=2.9.0 release=2.10.0
Changelog Changelog
2.10.0 add VARA to getardoplist script
add VARA to getardoplist-cron script
add Pat Autoconnect VARA script
add VARA modem to auto connect
add VARA gateway search
add modem check to start vara hf script
add modem check to start vara fm script
add current user to login/logout screen - https://github.com/km4ack/patmenu2/issues/62 Thanks WB8SFY
fix login cancel not returning to previous screen - https://github.com/km4ack/patmenu2/issues/62 Thanks WB8SFY
add current grid to manual grid update screen - https://github.com/km4ack/patmenu2/issues/62 Thanks WB8SFY
fix false ruby warning with GPS grid update - https://github.com/km4ack/patmenu2/issues/62 Thanks WB8SFY
update ruby install to 2.5
add current grid to main screen - https://github.com/km4ack/patmenu2/issues/61
2.9.0 add 100 Mobiles to Position Request screen in catalog - https://github.com/km4ack/patmenu2/issues/51 2.9.0 add 100 Mobiles to Position Request screen in catalog - https://github.com/km4ack/patmenu2/issues/51
fix stop modems - https://github.com/km4ack/patmenu2/issues/51 fix stop modems - https://github.com/km4ack/patmenu2/issues/51
add wait for internet to getardoplist-cron - https://github.com/km4ack/patmenu2/issues/50 add wait for internet to getardoplist-cron - https://github.com/km4ack/patmenu2/issues/50

View File

@ -18,6 +18,7 @@ TODAY=$(date)
#path where files are located #path where files are located
#must match path in findardop script #must match path in findardop script
MYPATH=$HOME/patmenu2/ardop-list/ MYPATH=$HOME/patmenu2/ardop-list/
MYVARA=$HOME/patmenu2/vara-list/
#my log file #my log file
LOG=$HOME/Documents/mylog.txt LOG=$HOME/Documents/mylog.txt
@ -33,15 +34,24 @@ yad --center \
fi fi
#make directory if it doesn't exist #make directory if it doesn't exist
mkdir -p $MYPATH mkdir -p $MYPATH $MYVARA
#set variables for each list #set variables for each ardop list
FILE=$MYPATH'ardoplist.txt' FILE=$MYPATH'ardoplist.txt'
EIGHTY=$MYPATH'80mardoplist.txt' EIGHTY=$MYPATH'80mardoplist.txt'
FORTY=$MYPATH'40mardoplist.txt' FORTY=$MYPATH'40mardoplist.txt'
TWENTY=$MYPATH'20mardoplist.txt' TWENTY=$MYPATH'20mardoplist.txt'
THIRTY=$MYPATH'30mardoplist.txt' THIRTY=$MYPATH'30mardoplist.txt'
PACKET=$MYPATH'packet.txt' PACKET=$MYPATH'packet.txt'
#set variables for each vara list
VARAFILE=$MYVARA'varalist.txt'
VARAEIGHTY=$MYVARA'80mvaralist.txt'
VARAFORTY=$MYVARA'40mvaralist.txt'
VARATWENTY=$MYVARA'20mvaralist.txt'
VARATHIRTY=$MYVARA'30mvaralist.txt'
VARAFM=$MYVARA'varafm.txt'
GRID=$(grep locator $XDG_CONFIG_HOME/pat/config.json | sed 's/"locator"://;s/"//g;s/,//;s/ //g') GRID=$(grep locator $XDG_CONFIG_HOME/pat/config.json | sed 's/"locator"://;s/"//g;s/,//;s/ //g')
echo "GRID=$GRID" > $HOME/patmenu2/.grid echo "GRID=$GRID" > $HOME/patmenu2/.grid
@ -62,7 +72,33 @@ else
yad --center --timeout=3 --timeout-indicator=top --no-buttons --text="You are not connected to the internet" yad --center --timeout=3 --timeout-indicator=top --no-buttons --text="You are not connected to the internet"
exit exit
fi fi
#remove old files before downloading new ones #remove old vara files before downloading new ones
if [ -f $VARATHIRTY ]; then
rm $VARATHIRTY
fi
if [ -f $VARAFILE ]; then
rm $VARAFILE
fi
if [ -f $VARAEIGHTY ]; then
rm $VARAEIGHTY
fi
if [ -f $VARAFORTY ]; then
rm $VARAFORTY
fi
if [ -f $VARATWENTY ]; then
rm $VARATWENTY
fi
if [ -f $VARAFM ]; then
rm $VARAFM
fi
#remove old ardop list before downloading new ones
if [ -f $THIRTY ]; then if [ -f $THIRTY ]; then
rm $THIRTY rm $THIRTY
fi fi
@ -103,10 +139,99 @@ pat rmslist -s --band 40m --mode ardop --force-download >> $FORTY
pat rmslist -s --band 20m --mode ardop --force-download >> $TWENTY pat rmslist -s --band 20m --mode ardop --force-download >> $TWENTY
pat rmslist -s --band 30m --mode ardop --force-download >> $THIRTY pat rmslist -s --band 30m --mode ardop --force-download >> $THIRTY
pat rmslist -s --mode packet --force-download >> $PACKET pat rmslist -s --mode packet --force-download >> $PACKET
pat rmslist -s --mode vara --force-download >> $VARAFILE
pat rmslist -s --band 80m --mode vara --force-download >> $VARAEIGHTY
pat rmslist -s --band 40m --mode vara --force-download >> $VARAFORTY
pat rmslist -s --band 20m --mode vara --force-download >> $VARATWENTY
pat rmslist -s --band 30m --mode vara --force-download >> $VARATHIRTY
pat rmslist -s --band 2m --mode varafm --force-download >> $VARAFM
yad --center --timeout=2 --timeout-indicator=top --no-buttons --text="Downloads Done" & yad --center --timeout=2 --timeout-indicator=top --no-buttons --text="Downloads Done" &
} }
DL | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center \ DL | yad --center --progress --pulsate --auto-close --no-buttons --text-align=center \
--text="Downloading....This takes ~30 seconds\r<b>DO NOT CLOSE THIS WINDOW</b>\rDoing so will abort the download." --text="Downloading....This takes ~30 seconds\r<b>DO NOT CLOSE THIS WINDOW</b>\rDoing so will abort the download."
#as of August 2022 the downloaded VARA lists do not include the URL needed for pat.
#This section will generate the needed URL and update the downloaded files.
#####GENERATE URL FOR 20M VARA File###########
VARATEMP=/run/user/$UID/varatemp
if [ -f $VARATEMP ]; then
rm $VARATEMP
fi
sed -i '/^$/d' $VARATWENTY
sed -i '1,3d' $VARATWENTY
while read -r line; do
CALL=$(echo $line | awk '{print$1}')
FREQ=$(echo $line | sed 's/.*14./14./' | awk '{print$1}' | sed 's/\.//')
URL="vara:///$CALL?freq=$FREQ"
echo $line | sed "s|<nil>|${URL}|" >> $VARATEMP
done <$VARATWENTY
mv $VARATEMP $VARATWENTY
##############################################
#####GENERATE URL FOR 30M VARA File###########
VARATEMP=/run/user/$UID/varatemp
if [ -f $VARATEMP ]; then
rm $VARATEMP
fi
sed -i '/^$/d' $VARATHIRTY
sed -i '1,3d' $VARATHIRTY
while read -r line; do
CALL=$(echo $line | awk '{print$1}')
FREQ=$(echo $line | sed 's/.*10./10./' | awk '{print$1}' | sed 's/\.//')
URL="vara:///$CALL?freq=$FREQ"
echo $line | sed "s|<nil>|${URL}|" >> $VARATEMP
done <$VARATHIRTY
mv $VARATEMP $VARATHIRTY
##############################################
#####GENERATE URL FOR 40M VARA File###########
VARATEMP=/run/user/$UID/varatemp
if [ -f $VARATEMP ]; then
rm $VARATEMP
fi
sed -i '/^$/d' $VARAFORTY
sed -i '1,3d' $VARAFORTY
while read -r line; do
CALL=$(echo $line | awk '{print$1}')
FREQ=$(echo $line | sed 's/.*7./7./' | awk '{print$1}' | sed 's/\.//')
URL="vara:///$CALL?freq=$FREQ"
echo $line | sed "s|<nil>|${URL}|" >> $VARATEMP
done <$VARAFORTY
mv $VARATEMP $VARAFORTY
##############################################
#####GENERATE URL FOR 80M VARA File###########
VARATEMP=/run/user/$UID/varatemp
if [ -f $VARATEMP ]; then
rm $VARATEMP
fi
sed -i '/^$/d' $VARAEIGHTY
sed -i '1,3d' $VARAEIGHTY
while read -r line; do
CALL=$(echo $line | awk '{print$1}')
FREQ=$(echo $line | sed 's/.*3./3./' | awk '{print$1}' | sed 's/\.//')
URL="vara:///$CALL?freq=$FREQ"
echo $line | sed "s|<nil>|${URL}|" >> $VARATEMP
done <$VARAEIGHTY
mv $VARATEMP $VARAEIGHTY
##############################################
if [ -f "$FILE" ] if [ -f "$FILE" ]
then then
echo $TODAY" RMS Gateway list download Success" >> $LOG echo $TODAY" RMS Gateway list download Success" >> $LOG

View File

@ -65,6 +65,7 @@ exit
LOGIN(){ LOGIN(){
CONFIG=$XDG_CONFIG_HOME/pat/config.json CONFIG=$XDG_CONFIG_HOME/pat/config.json
WHO=$(whoami) WHO=$(whoami)
CURRENT_USER=$(grep mycall $CONFIG | head -1 | sed 's/"mycall": "//;s/ //g;s/",//')
USER=$(yad --form --width=420 --text-align=center --center --title="Pat Log In/Out" --text-align=center \ USER=$(yad --form --width=420 --text-align=center --center --title="Pat Log In/Out" --text-align=center \
@ -73,16 +74,16 @@ USER=$(yad --form --width=420 --text-align=center --center --title="Pat Log In/O
--field="Call Sign" "" \ --field="Call Sign" "" \
--field="Winlink Password" "" \ --field="Winlink Password" "" \
--field="Six Character Grid Square" "EM65TV" \ --field="Six Character Grid Square" "EM65TV" \
--field="Current User Logged In ---- <b>$CURRENT_USER</b>":LBL \
--button="Log In":2 \ --button="Log In":2 \
--button="Log Out":3 \ --button="Log Out":3 \
--button="Cancel":1) --button="Cancel":1)
BUT=$? BUT=$?
if [ $BUT = 252 ]; then if [ $BUT = 252 ]; then
echo "true exit"
exit exit
elif [ $BUT = 1 ]; then elif [ $BUT = 1 ]; then
echo "cancel" $MAIN
elif [ $BUT = 2 ]; then elif [ $BUT = 2 ]; then
echo "Log IN" echo "Log IN"
CALLSIGN=$(echo $USER | awk -F "|" '{print $1}') CALLSIGN=$(echo $USER | awk -F "|" '{print $1}')
@ -120,9 +121,9 @@ fi
GPSGRID(){ GPSGRID(){
CONFIG=$XDG_CONFIG_HOME/pat/config.json CONFIG=$XDG_CONFIG_HOME/pat/config.json
RUBY_INSTALLED=$(which ruby)
if ! hash ruby2.3 2>/dev/null; then if [ -z "$RUBY_INSTALLED" ]; then
echo "Ruby Not found on system"
yad --form --width=300 --text-align=center --center --title="Ruby not Found" --text-align=center \ yad --form --width=300 --text-align=center --center --title="Ruby not Found" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \ --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="Ruby is needed to read GPS data but not found installed on your system. Would you like to install it now?" \ --text="Ruby is needed to read GPS data but not found installed on your system. Would you like to install it now?" \
@ -135,7 +136,7 @@ BUT=$?
elif [ $BUT = 2 ]; then elif [ $BUT = 2 ]; then
INSTALLRUBY(){ INSTALLRUBY(){
sudo apt-get update sudo apt-get update
sudo apt-get install -y ruby2.3 sudo apt-get install -y ruby2.5
sudo gem install gpsd_client sudo gem install gpsd_client
sudo gem install maidenhead sudo gem install maidenhead
} }
@ -327,11 +328,13 @@ MANUALGPS() {
WHO=$(whoami) WHO=$(whoami)
CONFIG=$XDG_CONFIG_HOME/pat/config.json CONFIG=$XDG_CONFIG_HOME/pat/config.json
CURRENT_GRID=$(grep locator $CONFIG | sed 's/"locator": "//;s/ //g;s/",//')
GRID=$(yad --form --width=400 --text-align=center --center --title="Set Grid" --text-align=center \ GRID=$(yad --form --width=400 --text-align=center --center --title="Set Grid" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \ --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="<b>Update Pat Grid</b> by KM4ACK" \ --text="<b>Update Pat Grid</b> by KM4ACK" \
--field="Six Character Grid": "$NEWGRID" \ --field="Six Character Grid": "$NEWGRID" \
--field="Current Grid -------- <b>$CURRENT_GRID</b>":LBL \
--button="Update Grid":2 \ --button="Update Grid":2 \
--button="Cancel":1) --button="Cancel":1)
BUT=$? BUT=$?

View File

@ -6,7 +6,6 @@ MAIN=$MYPATH/./patmenu
PATCONFIG=$XDG_CONFIG_HOME/pat/config.json PATCONFIG=$XDG_CONFIG_HOME/pat/config.json
AUTOPAT(){ AUTOPAT(){
source $MYPATH/config source $MYPATH/config
if [ $RIGCONTROL == 'no' ] if [ $RIGCONTROL == 'no' ]
then then
@ -26,6 +25,7 @@ MAX="500|550|600|650|700|750|800|850|900|950|1000|1500|2000|2500|3000"
INFO=$(yad --form --width=420 --text-align=center --center --title="Pat Auto" --text-align=center \ INFO=$(yad --form --width=420 --text-align=center --center --title="Pat Auto" --text-align=center \
--image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \ --image $LOGO --window-icon=$LOGO --image-on-top --separator="|" --item-separator="|" \
--text="<b>Pat Auto Connect</b> by KM4ACK" \ --text="<b>Pat Auto Connect</b> by KM4ACK" \
--field="Modem":CB "VARA|ARDOP" \
--field="Band":CB "20|30|40|80" \ --field="Band":CB "20|30|40|80" \
--field="Minimum Distance":CBE "$MIN" \ --field="Minimum Distance":CBE "$MIN" \
--field="Maximum Distance":CBE "$MAX" \ --field="Maximum Distance":CBE "$MAX" \
@ -37,9 +37,15 @@ $MAIN
exit exit
fi fi
BAND=$(echo $INFO | awk -F "|" '{print $1}') MODEM=$(echo $INFO | awk -F "|" '{print $1}')
MIN=$(echo $INFO | awk -F "|" '{print $2}') BAND=$(echo $INFO | awk -F "|" '{print $2}')
MAX=$(echo $INFO | awk -F "|" '{print $3}') MIN=$(echo $INFO | awk -F "|" '{print $3}')
MAX=$(echo $INFO | awk -F "|" '{print $4}')
#echo "Modem = $MODEM"
#echo "Band = $BAND"
#echo "MIN = $MIN"
#echo "MAX = $MAX"
if [ -z "$MIN" ]; then if [ -z "$MIN" ]; then
MIN=0 MIN=0
@ -57,11 +63,14 @@ yad --form --width=420 --text-align=center --center --title="Pat Auto" --text-al
--button=gtk-ok --button=gtk-ok
AUTOPAT AUTOPAT
fi fi
echo "Band = $BAND"
echo "MIN = $MIN"
echo "MAX = $MAX"
#set correct comamnd for modem
if [ "$MODEM" = 'ARDOP' ]; then
lxterminal -e $MYPATH/autopat $MAX $BAND $MIN lxterminal -e $MYPATH/autopat $MAX $BAND $MIN
elif [ "$MODEM" = 'VARA' ]; then
lxterminal -e $MYPATH/autopat-vara $MAX $BAND $MIN
fi
$MAIN $MAIN
} }

View File

@ -44,6 +44,7 @@ fi
#get name of current config file #get name of current config file
source $MYPATH/.currentconf source $MYPATH/.currentconf
CONFIG=$(echo $CONF | sed 's/.config//') CONFIG=$(echo $CONF | sed 's/.config//')
CURRENT_GRID=$(grep locator $XDG_CONFIG_HOME/pat/config.json | sed 's/"locator": "//;s/ //g;s/",//')
if [ -z $CONFIG ]; then if [ -z $CONFIG ]; then
CONFIG=default CONFIG=default
fi fi
@ -61,10 +62,11 @@ yad --form --width=420 --text-align=center --center --title="Pat Menu" --text-al
--field="Settings/Config":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/manage-menu"' \ --field="Settings/Config":fbtn 'bash -c "kill -USR1 $YAD_PID; $MYPATH/manage-menu"' \
--field="Quick Stats":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/pat-functions; STATS"' \ --field="Quick Stats":fbtn 'bash -c "kill -USR1 $YAD_PID; source $MYPATH/pat-functions; STATS"' \
--field="My Call - $MYCALLSIGN":LBL \ --field="My Call - $MYCALLSIGN":LBL \
--field="Config=$CONFIG":LBL \ --field="Config - $CONFIG":LBL \
--field="Grid - $CURRENT_GRID":LBL \
--button="QUIT":1 --button="QUIT":1
BUT=$? BUT=$?
if [ $BUT = 1 ] && [ "$AMRRON" = 'no' ]; then if [ $BUT = 1 ]; then
sudo killall piardopc kissattach direwolf piARDOP_GUI rigctld > /dev/null 2>&1 exit
fi fi

View File

@ -7,6 +7,14 @@ MYPATH=$HOME/patmenu2
LOGO=$MYPATH/pmlogo.png LOGO=$MYPATH/pmlogo.png
source $MYPATH/config source $MYPATH/config
if [ ! -f $HOME/.wine/drive_c/VARA\ FM/VARAFM.exe ]; then
yad --title="FAILED" --width=400 --height=100 \
--image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
--center --form --text="VARA FM Modem not installed" \
--button=gtk-ok
exit
fi
#Check if FLRIG is running if user has it set in config file #Check if FLRIG is running if user has it set in config file
if [ "$RIGCONTROL" = 'yes' ]; then if [ "$RIGCONTROL" = 'yes' ]; then
echo "rig control is on" echo "rig control is on"

View File

@ -7,6 +7,15 @@ MYPATH=$HOME/patmenu2
LOGO=$MYPATH/pmlogo.png LOGO=$MYPATH/pmlogo.png
source $MYPATH/config source $MYPATH/config
#check if VARA HF modem is installed
if [ ! -f $HOME/.wine/drive_c/VARA/VARA.exe ]; then
yad --title="FAILED" --width=400 --height=100 \
--image $LOGO --window-icon=$LOGO --image-on-top --text-align=center \
--center --form --text="VARA Modem not installed" \
--button=gtk-ok
exit
fi
#Check if FLRIG is running if user has it set in config file #Check if FLRIG is running if user has it set in config file
if [ "$RIGCONTROL" = 'yes' ]; then if [ "$RIGCONTROL" = 'yes' ]; then
echo "rig control is on" echo "rig control is on"