1
0
mirror of https://github.com/km4ack/patmenu2.git synced 2025-05-19 00:00:11 -07:00

add version check

This commit is contained in:
KM4ACK 2021-12-24 07:04:13 -06:00
parent 2bef42523b
commit 82586cab5c

View File

@ -22,7 +22,15 @@ MYPATH=$HOME/patmenu2/ardop-list/
#my log file #my log file
LOG=$HOME/Documents/mylog.txt LOG=$HOME/Documents/mylog.txt
GRIDCK=$(jq .locator $HOME/.wl2k/config.json) #set config file location for pat version
VERSION=$(pat version | awk '{print $2}' | awk -F "." '{print $2}')
if [ $VERSION -le 11 ]; then
MYCONFIG=$HOME/.wl2k/config.json
else
MYCONFIG=$HOME/.config/pat/config.json
fi
GRIDCK=$(jq .locator $MYCONFIG)
if [ ${#GRIDCK} -lt 3 ] if [ ${#GRIDCK} -lt 3 ]
then then
echo "Grid square not set in Pat Configure" | tee -a $LOG echo "Grid square not set in Pat Configure" | tee -a $LOG
@ -30,7 +38,7 @@ echo "Distances/Bearings will not be accurate"
exit exit
fi fi
GRID=$(grep locator ~/.wl2k/config.json | sed 's/"locator"://;s/"//g;s/,//;s/ //g') GRID=$(grep locator $MYCONFIG | sed 's/"locator"://;s/"//g;s/,//;s/ //g')
echo "GRID=$GRID" > $HOME/patmenu2/.grid echo "GRID=$GRID" > $HOME/patmenu2/.grid
#make directory if it doesn't exist #make directory if it doesn't exist