#!/bin/bash ######################################################## ### bash <(curl -fsSL https://raw.lhy.life/wgcf.sh) ######################################################## function CheckCmd() { local cmd="$1" if ! command -v "$cmd" &>/dev/null; then echo "Error: command \"$cmd\" not found." exit 1 fi } CheckCmd "curl" CheckCmd "jq" DOWNLOADLINK=$(curl -s "https://api.github.com/repos/ViRb3/wgcf/releases/latest" | jq -r '.assets[] | select(.browser_download_url | test("_linux_amd64")).browser_download_url') mkdir -p "$HOME/apps/wgcf" cd "$HOME/apps/wgcf" wget -O wgcf "$DOWNLOADLINK" chmod +x wgcf ./wgcf -h