Skip to content

Commit c3b2ace

Browse files
committed
check if jq and wget are installed before downloading the latest version
1 parent f1f77e0 commit c3b2ace

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

tools/downloader.sh

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,24 @@
11
#!/bin/bash
2-
owner=psyb0t
3-
repo=ssh-tunnel-swarm
4-
asset_name=ssh-tunnel-swarm
2+
3+
# Check if jq is installed
4+
echo "Checking if jq is installed..."
5+
if ! command -v jq &>/dev/null; then
6+
echo "jq is required but not installed. Please install jq (e.g., 'sudo apt-get install jq') and try again."
7+
exit 1
8+
fi
9+
echo "jq is installed."
10+
11+
# Check if wget is installed
12+
echo "Checking if wget is installed..."
13+
if ! command -v wget &>/dev/null; then
14+
echo "wget is required but not installed. Please install wget (e.g., 'sudo apt-get install wget') and try again."
15+
exit 1
16+
fi
17+
echo "wget is installed."
18+
19+
owner="psyb0t"
20+
repo="ssh-tunnel-swarm"
21+
asset_name="ssh-tunnel-swarm"
522

623
echo "Looking up the latest release of $asset_name for github.com/$owner/$repo..."
724
releases=$(wget -qO- "https://api.github.com/repos/$owner/$repo/releases")

0 commit comments

Comments
 (0)