From c40954115bfb5c8ef6b340a0e08ade8f530aa710 Mon Sep 17 00:00:00 2001 From: elseif Date: Tue, 26 Aug 2025 17:22:44 +0800 Subject: [PATCH] Update chr.sh Signed-off-by: elseif --- chr.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/chr.sh b/chr.sh index 307ac80..5bb3dc0 100644 --- a/chr.sh +++ b/chr.sh @@ -50,7 +50,14 @@ if [[ "$confirm" =~ ^[Nn]$ ]]; then fi echo "FILE: $(basename $IMG_URL)" -wget --no-check-certificate -O /tmp/chr.img.zip "$IMG_URL" || { echo "Download failed!"; exit 1; } +if command -v wget >/dev/null 2>&1; then + wget --no-check-certificate -O /tmp/chr.img.zip "$IMG_URL" || { echo "Download failed!"; exit 1; } +elif command -v curl >/dev/null 2>&1; then + curl -L --insecure -o /tmp/chr.img.zip "$IMG_URL" || { echo "Download failed!"; exit 1; } +else + echo "Neither wget nor curl is installed. Cannot download $url" + exit 1 +fi cd /tmp unzip -p chr.img.zip > chr.img if LOOP=$(losetup -Pf --show chr.img 2>/dev/null); then