Skip to content

Commit

Permalink
Merge pull request #449 from km4ack/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
km4ack authored Oct 17, 2022
2 parents 2cdb4eb + 3175e9d commit 2f79139
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build-a-pi
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ fi
#If VARA is chosen, make sure we have a Pi 4 32 bit system to work with.
#As of 02OCT2022 the VARA installer only works with the Pi 4.
VARA_CHK=$(grep VARA ${BASE})
if [ -n $VARA_CHK ]; then
if [ -n "$VARA_CHK" ]; then
FREEMEM=$(free -m | grep Mem: | awk '{ print $2 }')
if [ $FREEMEM -lt 1500 ]; then
echo "Not enough memory available"
Expand Down
1 change: 1 addition & 0 deletions changelog
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ version=3.3.0
update chirp install - https://github.com/km4ack/pi-build/issues/337
use 64bit package to install pat on 64bit OS - https://github.com/km4ack/pi-build/issues/424
Add RepeaterStart - https://github.com/km4ack/pi-build/issues/400
fix gridtracker download - https://github.com/km4ack/pi-build/issues/447
3.2.4 Update HotSpot Tools shortcut
Change 1000 to UID in update script
Remove Pi username check
Expand Down
27 changes: 16 additions & 11 deletions functions/additional.function
Original file line number Diff line number Diff line change
Expand Up @@ -510,27 +510,29 @@ EOF
sudo mv qsstv.desktop /usr/share/applications/

}

##################################
# GRIDTRACKER
##################################
GRIDTRACKER() {
#due to constant changes to GT website, get the download link from a file on KM4ACK github.
cd /run/user/$UID/
wget https://raw.githubusercontent.com/km4ack/pi-scripts/master/gt-download-links
cd ${HOME} || return
sudo apt-get install -y libgconf-2-4

#determine if 32/64 bit and set download link accordingly. issue #382
if [ `getconf LONG_BIT` = '32' ]; then
#GRIDDLL=$(curl -s https://download.gridtracker.org/latest_release.html | grep arm32 | sed 's/.*href="//;s/">.*//')
GRIDDLL=$(curl -s https://storage.googleapis.com/gt_download/ | awk 'BEGIN{FS="<Key>"; OFS="\n<Key>"} {$1=$1} 1' | grep arm32 | sed '/<Key>nwjs/d;/<Key>test/d' | head -1 | sed 's/<Key>//;s/<\/Key>.*//')
GT_DIR=$(echo $GRIDDLL | sed 's|/.*||')
GRIDDLL=$(echo $GRIDDLL | sed 's/.*GridTracker/GridTracker/')
GRIDDLL=$(cat /run/user/$UID/gt-download-links | grep arm32 | sed 's/arm32=//')
GT_TAR_NAME=$(echo $GRIDDLL | sed 's/.*GridTracker/GridTracker/')

else
#GRIDDLL=$(curl -s https://download.gridtracker.org/latest_release.html | grep arm64 | sed 's/.*href="//;s/">.*//')
GRIDDLL=$(curl -s https://storage.googleapis.com/gt_download/ | awk 'BEGIN{FS="<Key>"; OFS="\n<Key>"} {$1=$1} 1' | grep arm32 | sed '/<Key>nwjs/d;/<Key>test/d' | head -1 | sed 's/<Key>//;s/<\/Key>.*//')
GT_DIR=$(echo $GRIDDLL | sed 's|/.*||')
GRIDDLL=$(echo $GRIDDLL | sed 's/.*GridTracker/GridTracker/')
GRIDDLL=$(cat /run/user/$UID/gt-download-links | grep arm64 | sed 's/arm64=//')
GT_TAR_NAME=$(echo $GRIDDLL | sed 's/.*GridTracker/GridTracker/')
fi
wget --tries 2 --connect-timeout=60 https://storage.googleapis.com/gt_download/$GT_DIR/$GRIDDLL
GRIDTAR=$(echo $GRIDDLL | sed 's/.*\///g')
tar -xzvf $GRIDTAR

wget --tries 2 --connect-timeout=60 $GRIDDLL
tar -xzvf $GT_TAR_NAME
rm GridTracker*.gz
#determine if 32/64 bit and get correct directory name.
if [ `getconf LONG_BIT` = '32' ]; then
Expand All @@ -539,6 +541,8 @@ GRIDTRACKER() {
OLDFOLDER=$(ls | grep GridTracker*-linux-arm64)
fi
mv "$OLDFOLDER" $HOME/GridTracker


cat >gridtracker.desktop <<EOF
[Desktop Entry]
Name=GridTracker
Expand All @@ -558,6 +562,7 @@ EOF

}


##################################
# PROPAGATION
##################################
Expand Down
2 changes: 1 addition & 1 deletion update
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ fi
#If VARA is chosen, make sure we have a Pi 4 to work with.
#As of 02OCT2022 the VARA installer only works with the Pi 4.
VARA_CHK=$(grep VARA ${BASE})
if [ -n $VARA_CHK ]; then
if [ -n "$VARA_CHK" ]; then
FREEMEM=$(free -m | grep Mem: | awk '{ print $2 }')
if [ $FREEMEM -lt 1500 ]; then
echo "Not enough memory available"
Expand Down

0 comments on commit 2f79139

Please sign in to comment.