1
0
mirror of https://github.com/km4ack/patmenu2.git synced 2025-05-21 09:10:10 -07:00

add vara download

This commit is contained in:
KM4ACK 2022-08-31 08:14:42 -05:00
parent 211650bdf5
commit 1a137a2265

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 @@ exit
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