From 82586cab5c72f930587e5cb020a94bd25ebbd476 Mon Sep 17 00:00:00 2001 From: KM4ACK Date: Fri, 24 Dec 2021 07:04:13 -0600 Subject: [PATCH] add version check --- .getardoplist-cron | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.getardoplist-cron b/.getardoplist-cron index ee84704..3c2f7d8 100755 --- a/.getardoplist-cron +++ b/.getardoplist-cron @@ -22,7 +22,15 @@ MYPATH=$HOME/patmenu2/ardop-list/ #my log file 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 ] then echo "Grid square not set in Pat Configure" | tee -a $LOG @@ -30,7 +38,7 @@ echo "Distances/Bearings will not be accurate" exit 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 #make directory if it doesn't exist