enhance portability (detect user-preferred bash, replace all greps with awk)

pull/857/head
nivesh 2026-01-21 05:00:05 -05:00 committed by ginuerzh
parent 4c69940f1e
commit 646d3f906c
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/usr/bin/env bash
# Check Root User # Check Root User
@ -66,7 +66,7 @@ install_gost() {
;; ;;
esac esac
get_download_url="$base_url/tags/$version" get_download_url="$base_url/tags/$version"
download_url=$(curl -s "$get_download_url" | grep -Eo "\"browser_download_url\": \".*${os}.*${cpu_arch}.*\"" | awk -F'["]' '{print $4}') download_url=$(curl -s "$get_download_url" | awk -F'"' -v re=".*${os}.*${cpu_arch}.*" '/"browser_download_url":/ && $4 ~ re { print $4 }')
# Download the binary # Download the binary
echo "Downloading gost version $version..." echo "Downloading gost version $version..."