File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ printf '\n%s' "cd /usr/local/bin && find . -xtype l -exec rm {} \;" >> ../remove
1212chmod a+x ../remove || exit 1
1313
1414# DOWNLOAD AND PREPARE THE APP, $version is also used for updates
15- version=$( curl -Ls https://developer.android.com/tools/releases/platform-tools | grep -Po ' (?<= data-text=")[^"]* ' | grep -Eo " ( [0-9]{1,}\.)+[0-9]{1,} " | head -1)
15+ version=$( curl -Ls https://developer.android.com/tools/releases/platform-tools | tr ' ' ' \n ' | grep data-text | tr ' "= ' ' \n ' | grep " ^ [0-9]" | head -1)
1616wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip || exit 1
1717[ -e ./* 7z ] && 7z x ./* 7z && rm -f ./* 7z
1818[ -e ./* tar.* ] && tar fx ./* tar.* && rm -f ./* tar.*
3535APP=platform-tools
3636SITE="https://developer.android.com/tools/releases/platform-tools"; METAPKG="REPLACETHIS"
3737version0=$(cat /opt/$APP/version)
38- version=$(curl -Ls https://developer.android.com/tools/releases/platform-tools | grep -Po '(?<= data-text=")[^"]*' | grep -Eo "( [0-9]{1,}\.)+[0-9]{1,} " | head -1)
38+ version=$(curl -Ls https://developer.android.com/tools/releases/platform-tools | tr ' ' '\n' | grep data-text | tr '"=' '\n' | grep "^ [0-9]" | head -1)
3939[ -n "$version" ] || { echo "Error getting link"; exit 1; }
4040if [ "$version" != "$version0" ]; then
4141 mkdir "/opt/$APP/tmp" && cd "/opt/$APP/tmp" || exit 1
You can’t perform that action at this time.
0 commit comments