Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Connect/Connect-Installer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This is an automated Bash script designed to simplify the installation of the Ze
Run the script directly:

```bash
bash <(curl -sSL https://github.com/zeronetworks/Community/blob/master/Connect/Connect-Installer/installer.sh)
bash <(curl -sSL https://raw.githubusercontent.com/zeronetworks/Community/refs/heads/master/Connect/Connect-Installer/installer.sh)
```

You'll be prompted for:
Expand All @@ -34,7 +34,7 @@ You'll be prompted for:
### Option 2: With CLI arguments

```bash
bash <(curl -sSL https://github.com/zeronetworks/Community/blob/master/Connect/Connect-Installer/installer.sh) --url <PACKAGE_URL>
bash <(curl -sSL https://raw.githubusercontent.com/zeronetworks/Community/refs/heads/master/Connect/Connect-Installer/installer.sh) --url <PACKAGE_URL>
```

You can also set your token as an environment variable:
Expand All @@ -51,7 +51,7 @@ This avoids the interactive token prompt.

```bash
export ZNC_TOKEN="<your_jwt_token>"
bash <(curl -sSL https://github.com/zeronetworks/Community/blob/master/Connect/Connect-Installer/installer.sh) --url "https://download.link/path/to/zero-connect-server-setup-<version>.zip"
bash <(curl -sSL https://raw.githubusercontent.com/zeronetworks/Community/refs/heads/master/Connect/Connect-Installer/installer.sh) --url "https://download.link/path/to/zero-connect-server-setup-<version>.zip"
```

---
Expand Down
21 changes: 16 additions & 5 deletions Connect/Connect-Installer/installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,24 @@ while [[ $# -gt 0 ]]; do
esac
done

# --- Tool check ---
for tool in curl unzip sudo; do
if ! command -v "$tool" &>/dev/null; then
echo "[ERROR] Missing required tool: $tool"
# --- Ensure unzip is installed ---
if ! command -v unzip &>/dev/null; then
echo "[INFO] 'unzip' not found. Attempting to install..."

if [[ $EUID -ne 0 ]]; then
echo "[INFO] Requesting sudo access to install 'unzip'..."
sudo apt update -y
sudo apt install -y unzip
else
apt update -y
apt install -y unzip
fi

if ! command -v unzip &>/dev/null; then
echo "[FATAL] Failed to install 'unzip'. Exiting."
exit 1
fi
done
fi

# --- Ask for URL if not provided ---
if [[ -z "$SCRIPT_URL" ]]; then
Expand Down