diff --git a/AmRRON-Setup-Script.sh b/AmRRON-Setup-Script.sh index 1e5c083..1decdd2 100755 --- a/AmRRON-Setup-Script.sh +++ b/AmRRON-Setup-Script.sh @@ -415,6 +415,13 @@ if hash voacapl 2>/dev/null; then else VOACAPLVER="NOT INSTALLED" 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 + ARDOPCFVER="NOT INSTALLED" +fi + } @@ -545,6 +552,12 @@ if [[ $NEWARDOP == "" ]]; then NEWARDOP="SERVER DOWN" fi +NEWARDOPCF=$(curl -L -s https://github.com/pflarue/ardop/releases/latest | grep -m 1 "Release Ardopcf v" | head -1 | awk -F 'v' '{print $2}' | awk -F ' ' '{print $1}') + +if [[ $NEWARDOPCF == "" ]]; then + NEWARDOPCF="SERVER DOWN" +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 @@ -1117,19 +1130,6 @@ function ardopcf_install() { if [[ $(uname -m) =~ (armv7l|aarch64) ]]; then ARDOP=$"piardopc" - if [[ -f $ARDOPDIR/$ARDOP ]]; then - echo "Making backup of current version" - mv $ARDOPDIR/$ARDOP $ARDOPDIR/${ARDOP}-$(date +%h%d).bak || - { ERRCODE="Failed to create backup of current ardop file"; errors; return; } - fi - - echo "Copying archived working $ARDOP version from "$DIR"/Files/piardopc." - #wget -P $ARDOPDIR -N http://www.cantab.net/users/john.\ -#wiseman/Downloads/Beta/$ARDOP && chmod +x $ARDOPDIR/$ARDOP || - mkdir -p $ARDOPDIR && cp $DIR/Files/piardopc $ARDOPDIR/$ARDOP && chmod +x $ARDOPDIR/$ARDOP || - { ERRCODE="Failed to download ardop"; errors; return; } - - else ARDOP=$"ardopc" @@ -1149,9 +1149,10 @@ function ardopcf_install() { { ERRCODE="Failed to clone ardopcf repo."; errors; return; } cd $ARDOPDIR/build/ardop && make || { ERRCODE="Failed to compile ardopcf"; errors; return; } - cp $ARDOPDIR/build/ardop/ardopcf $ARDOPDIR/ardopc || + cp $ARDOPDIR/build/ardop/ardopcf $ARDOPDIR/$ARDOP || { ERRCODE="Failed to copy ardopcf to the ARDOP Directory"; errors; return; } - rm -r $ARDOPDIR/build && touch $ARDOPDIR/$(date +"%Y%m%d") + rm -r $ARDOPDIR/build && touch $ARDOPDIR/v$NEWARDOPCF.txt || + { ERRCODE="Failed to remove build directory and create current date marker"; errors; return; } fi if [[ ! -f $HOME/.asoundrc ]]; then @@ -3461,7 +3462,7 @@ yad --image=$DIR/images/corps-icon.png --center --checklist --print-column=2 --s false "FLRIG" "FLRIG Radio Control Program" "${FLRIG}" "${NEWFLRIG}" \ false "FLWRAP" "FLWRAP Radio Control Program" "${FLWRAP}" "${NEWFLWRAP}" \ false "ARDOP" "Downloads the newest ARDOP v1 TNC" "Unknown" "${NEWARDOP}" \ - false "ARDOPCF" "Downloads the newest ARDOPCF TNC fork" "Unknown" "${NEWARDOP}" \ + false "ARDOPCF" "Downloads the newest ARDOPCF TNC fork" "Unknown" "${NEWARDOPCF}" \ false "ARDOPGUI" "Downloads the newest ARDOP Graphical User Interface" "Unknown" "${NEWARDOPGUI}" \ false "ARIM" "Amateur Radio Instant Messanger" "${ARIM}" "${NEWARIM}" \ false "GARIM" "Graphical ARIM interface" "${GARIM}" "${NEWGARIM}" \