Merge pull request #459 from SpudGunMan/chirp

fix chirp version checking
pull/464/head
KM4ACK 2022-10-19 11:09:54 -05:00 zatwierdzone przez GitHub
commit 1aec5a1769
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 14 dodań i 14 usunięć

Wyświetl plik

@ -251,28 +251,28 @@ CHECK() {
# CHRIP
#----------------------------------------------------#
echo "Checking Chirp"
if ! hash chirpw 2>/dev/null; then
if ! hash chirp 2>/dev/null; then
echo "CHIRP=Not_Installed" >> $UPDATEFILE
else
echo "CHIRP=Installed" >> $UPDATEFILE
fi
OLDCODE(){
#old code left for reference
if ! hash chirpw 2>/dev/null; then
echo "CHIRP=Not_Installed" >> $UPDATEFILE
else
CP=$(chirpw --version)
#bash function this could be moved to the top of the file and used globally
#to short hand lookups on GIT release pages
lastrelease() { git ls-remote --tags "$1" | cut -d/ -f3- | tail -n1; }
CP=$(chirp --version)
CHIRP=$(echo ${CP} | awk '{ print $2 }' | sed 's/daily-//')
NEWCHIRP=$(curl -s https://trac.chirp.danplanet.com/chirp_daily/LATEST/ |
grep .tar.gz | awk -F 'chirp-daily-' '{print $2}' | head -c 8)
NEWCHIRP=$(curl -s https://github.com/goldstar611/chirp-appimage/releases | grep Release- | head -1 | sed 's/.*Release-//;s/">//')
CP=$(chirp --version)
CHIRP=$(echo ${CP} | awk '{ print $2 }' | sed 's/daily-//')
#function above called here as shorthand
NEWCHIRP=$(lastrelease https://github.com/goldstar611/chirp-appimage)
if (($(echo "${NEWCHIRP} ${CHIRP}" | awk '{print ($1 > $2)}'))); then
echo "CHIRP=NEEDS-UPDATE" >> $UPDATEFILE
echo "CHIRP=NEEDS-UPDATE" >> $UPDATEFILE
else
echo "CHIRP=is_latest_version" >> $UPDATEFILE
echo "CHIRP=is_latest_version" >> $UPDATEFILE
fi
fi
}
#----------------------------------------------------#
# DIREWOLF
#----------------------------------------------------#