From 2d439f22b18815a2fdadc22e5224aed8e2bc2d51 Mon Sep 17 00:00:00 2001 From: tb14 Date: Mon, 30 Jun 2025 23:04:25 -0500 Subject: [PATCH] ardop gui version checking --- AmRRON-Setup-Script.sh | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/AmRRON-Setup-Script.sh b/AmRRON-Setup-Script.sh index cdf159a..15988a4 100755 --- a/AmRRON-Setup-Script.sh +++ b/AmRRON-Setup-Script.sh @@ -410,6 +410,16 @@ else fi fi +if [ -f $HOME/Radio/ARDOP/gui*.txt ]; then + ARDOPGUIVER=$(ls $HOME/Radio/ARDOP/gui* | awk -F 'ARDOP/gui-' '{print $2}' | awk -F '.txt' '{print $1}' ) +else + if [ -f $HOME/Radio/ARDOP/ARDOP_GUI ]; then + ARDOPGUIVER="UNABLE TO DETERMINE" + else + ARDOPGUIVER="NOT INSTALLED" + fi +fi + if [ -f $HOME/Radio/ARDOP/*.txt ]; then ARDOPCFVER=$(ls $HOME/Radio/ARDOP/v* | awk -F 'ARDOP/v' '{print $2}' | awk -F '.txt' '{print $1}' ) else @@ -562,7 +572,7 @@ fi if [[ ${PLAT} = "Raspbian" ]]; then NEWARDOPGUI=$(curl -s https://www.cantab.net/users/john.wiseman/Downloads/Beta/ | grep 'href="piARDOP_GUI"' | grep -o 20[0-9][0-9]-[0-9][0-9]-[0-9][0-9]) else -NEWARDOPGUI=$(curl -s https://www.cantab.net/users/john.wiseman/Downloads/Beta/ | grep 'href="ARDOP_GUI"' | grep -o 20[0-9][0-9]-[0-9][0-9]-[0-9][0-9]) +NEWARDOPGUI=$(curl -s https://www.cantab.net/users/john.wiseman/Downloads/Beta/ | grep "ARDOP_GUI" | grep -oP '\d{4}-\d{2}-\d{2}' | head -1 | xargs -I{} date -d {} +"%d%b%Y") fi if [[ $NEWARDOP == "" ]]; then @@ -1171,6 +1181,11 @@ function ardopcf_install() { function ardop_gui_install() { + if [[ ${ARDOPGUIVER} == ${NEWARDOPGUI} ]]; then + echo "ARDOPGUI already at current version" + return + fi + ARDOPDIR=$USERDIR/ARDOP if [[ $(uname -m) =~ (armv7l|aarch64) ]]; then @@ -1187,7 +1202,8 @@ function ardop_gui_install() { wiseman/Downloads/Beta/$ARDOPGUI && chmod +x $ARDOPDIR/$ARDOPGUI || { ERRCODE="Failed to download ardop_gui"; errors; return; } - + touch $ARDOPDIR/$NEWARDOPGUI.txt || + { ERRCODE="Failed to make ARDOP_GUI date marker"; errors; return; } else @@ -3992,7 +4008,7 @@ rc=$? if [[ $rc == 0 ]]; then sudo apt-get -y update && sudo apt-get -y upgrade elif [[ $rc == 2 ]]; then - echo "Skipping update check this time" + echo -e ${ACTION}"Skipping system apt update check."${NOCOLOR} elif [[ $rc == 1 ]]; then yad --image=$DIR/images/corps-icon.png --center --button="gtk-ok:0" --title "Exit Selected" --text "Exiting installer now" ${r} ${c} exit 1 @@ -4001,10 +4017,9 @@ rc=$? # Install git now. -if hash git 2>/dev/null; then - echo "Git is already installed" - else - sudo apt-get -y install git +if ! hash git 2>/dev/null; then + sudo apt-get -y install git > /dev/null + echo -e ${ACTION}Installing git${NOCOLOR} fi }