mirror of https://github.com/telemt/telemt.git
Update install.sh
This commit is contained in:
parent
c2f16a343a
commit
5b11522620
24
install.sh
24
install.sh
|
|
@ -192,7 +192,13 @@ verify_install_deps() {
|
||||||
detect_arch() {
|
detect_arch() {
|
||||||
sys_arch="$(uname -m)"
|
sys_arch="$(uname -m)"
|
||||||
case "$sys_arch" in
|
case "$sys_arch" in
|
||||||
x86_64|amd64) echo "x86_64" ;;
|
x86_64|amd64)
|
||||||
|
if [ -r /proc/cpuinfo ] && grep -q "avx2" /proc/cpuinfo 2>/dev/null && grep -q "bmi2" /proc/cpuinfo 2>/dev/null; then
|
||||||
|
echo "x86_64-v3"
|
||||||
|
else
|
||||||
|
echo "x86_64"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
aarch64|arm64) echo "aarch64" ;;
|
aarch64|arm64) echo "aarch64" ;;
|
||||||
*) die "Unsupported architecture: $sys_arch" ;;
|
*) die "Unsupported architecture: $sys_arch" ;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -500,7 +506,21 @@ case "$ACTION" in
|
||||||
die "Temp directory is invalid or was not created"
|
die "Temp directory is invalid or was not created"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fetch_file "$DL_URL" "${TEMP_DIR}/${FILE_NAME}" || die "Download failed"
|
if ! fetch_file "$DL_URL" "${TEMP_DIR}/${FILE_NAME}"; then
|
||||||
|
if [ "$ARCH" = "x86_64-v3" ]; then
|
||||||
|
say " -> x86_64-v3 build not found, falling back to standard x86_64..."
|
||||||
|
ARCH="x86_64"
|
||||||
|
FILE_NAME="${BIN_NAME}-${ARCH}-linux-${LIBC}.tar.gz"
|
||||||
|
if [ "$TARGET_VERSION" = "latest" ]; then
|
||||||
|
DL_URL="https://github.com/${REPO}/releases/latest/download/${FILE_NAME}"
|
||||||
|
else
|
||||||
|
DL_URL="https://github.com/${REPO}/releases/download/${TARGET_VERSION}/${FILE_NAME}"
|
||||||
|
fi
|
||||||
|
fetch_file "$DL_URL" "${TEMP_DIR}/${FILE_NAME}" || die "Download failed"
|
||||||
|
else
|
||||||
|
die "Download failed"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
say ">>> Stage 3: Extracting archive"
|
say ">>> Stage 3: Extracting archive"
|
||||||
if ! gzip -dc "${TEMP_DIR}/${FILE_NAME}" | tar -xf - -C "$TEMP_DIR" 2>/dev/null; then
|
if ! gzip -dc "${TEMP_DIR}/${FILE_NAME}" | tar -xf - -C "$TEMP_DIR" 2>/dev/null; then
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue