-
Notifications
You must be signed in to change notification settings - Fork 269
Expand file tree
/
Copy pathtermux.sh
More file actions
executable file
·41 lines (35 loc) · 1.05 KB
/
Copy pathtermux.sh
File metadata and controls
executable file
·41 lines (35 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env bash
set -euo pipefail
project_name="proxy-scraper-checker"
install_path="${HOME}/${project_name}"
abi=$(getprop ro.product.cpu.abi)
case "${abi}" in
"arm64-v8a")
target="aarch64-linux-android"
;;
"armeabi-v7a")
if grep -qi 'neon' /proc/cpuinfo; then
target="thumbv7neon-linux-androideabi"
else
target="armv7-linux-androideabi"
fi
;;
"armeabi")
target="arm-linux-androideabi"
;;
"x86")
target="i686-linux-android"
;;
"x86_64")
target="x86_64-linux-android"
;;
*)
echo "Unsupported CPU ABI: ${abi}" >&2
exit 1
;;
esac
download_path="${TMPDIR:-${PREFIX:-/data/data/com.termux/files/usr}/tmp}/${project_name}.zip"
trap 'rm -f "${download_path}"' EXIT
curl -fL --retry 3 --retry-all-errors -o "${download_path}" "https://nightly.link/monosans/${project_name}/workflows/ci/main/${project_name}-binary-${target}.zip"
unzip -qod "${install_path}" "${download_path}"
printf "%s installed successfully.\nRun 'cd %s && ./%s'.\n" "${project_name}" "${install_path}" "${project_name}"