diff --git a/setup-repos-nightly.sh b/setup-repos-nightly.sh index 2ebdd316a..ebb1c7428 100644 --- a/setup-repos-nightly.sh +++ b/setup-repos-nightly.sh @@ -1,2 +1,24 @@ -# Suppressed by webmin-setup-repo.sh -# https://raw.githubusercontent.com/webmin/webmin/master/webmin-setup-repo.sh +#!/bin/sh +# setup-repos-nightly.sh — suppressed by webmin-setup-repo.sh +# Sets up a production or testing repository for Webmin and Usermin packages +# on Debian-based and RPM-based systems + +NEW_SCRIPT_URL="https://raw.githubusercontent.com/webmin/webmin/master/\ +webmin-setup-repo.sh" + +for downloader in "curl -fsSL" "wget -qO-"; do + if command -v "${downloader%% *}" >/dev/null 2>&1; then + tmp_script=$(mktemp) + case $downloader in + curl*) curl -fsSL "$NEW_SCRIPT_URL" > "$tmp_script" ;; + wget*) wget -qO- "$NEW_SCRIPT_URL" > "$tmp_script" ;; + esac + sh "$tmp_script" "$@" + rm -f "$tmp_script" + exit 0 + fi +done + +# If neither downloader works, show an error +echo "Error: Neither curl nor wget is installed." >&2 +exit 1 diff --git a/setup-repos.sh b/setup-repos.sh index 2ebdd316a..0b0451e35 100644 --- a/setup-repos.sh +++ b/setup-repos.sh @@ -1,2 +1,24 @@ -# Suppressed by webmin-setup-repo.sh -# https://raw.githubusercontent.com/webmin/webmin/master/webmin-setup-repo.sh +#!/bin/sh +# setup-repos.sh — suppressed by webmin-setup-repo.sh +# Sets up a production or testing repository for Webmin and Usermin packages +# on Debian-based and RPM-based systems + +NEW_SCRIPT_URL="https://raw.githubusercontent.com/webmin/webmin/master/\ +webmin-setup-repo.sh" + +for downloader in "curl -fsSL" "wget -qO-"; do + if command -v "${downloader%% *}" >/dev/null 2>&1; then + tmp_script=$(mktemp) + case $downloader in + curl*) curl -fsSL "$NEW_SCRIPT_URL" > "$tmp_script" ;; + wget*) wget -qO- "$NEW_SCRIPT_URL" > "$tmp_script" ;; + esac + sh "$tmp_script" "$@" + rm -f "$tmp_script" + exit 0 + fi +done + +# If neither downloader works, show an error +echo "Error: Neither curl nor wget is installed." >&2 +exit 1 diff --git a/webmin-setup-repos-nightly.sh b/webmin-setup-repos-nightly.sh index 2ebdd316a..755c0f15e 100644 --- a/webmin-setup-repos-nightly.sh +++ b/webmin-setup-repos-nightly.sh @@ -1,2 +1,24 @@ -# Suppressed by webmin-setup-repo.sh -# https://raw.githubusercontent.com/webmin/webmin/master/webmin-setup-repo.sh +#!/bin/sh +# webmin-setup-repos-nightly.sh — suppressed by webmin-setup-repo.sh +# Sets up a production or testing repository for Webmin and Usermin packages +# on Debian-based and RPM-based systems + +NEW_SCRIPT_URL="https://raw.githubusercontent.com/webmin/webmin/master/\ +webmin-setup-repo.sh" + +for downloader in "curl -fsSL" "wget -qO-"; do + if command -v "${downloader%% *}" >/dev/null 2>&1; then + tmp_script=$(mktemp) + case $downloader in + curl*) curl -fsSL "$NEW_SCRIPT_URL" > "$tmp_script" ;; + wget*) wget -qO- "$NEW_SCRIPT_URL" > "$tmp_script" ;; + esac + sh "$tmp_script" "$@" + rm -f "$tmp_script" + exit 0 + fi +done + +# If neither downloader works, show an error +echo "Error: Neither curl nor wget is installed." >&2 +exit 1