Admin/Windows/Cygwin/setup_server
author wenzelm
Thu, 24 May 2018 22:17:23 +0200
changeset 68268 38b4d4f39434
child 71385 06bb82e7af2a
permissions -rwxr-xr-x
setup server directory for Cygwin quasi-mirror;

#!/usr/bin/env bash

CYGWIN_MAIN="https://cygwin.com"
CYGWIN_MIRROR="https://ftp.eq.uc.pt/software/pc/prog/cygwin"

function fail()
{
  echo "$1" >&2
  exit 2
}

function download()
{
  local URL="$1"
  local DIR="${2:-.}"
  mkdir -p "$DIR" || fail "Cannot create directory: \"$DIR\""
  echo "Downloading $URL ..."
  curl --fail --silent "$URL" > "$DIR"/"$(basename "$URL")" || fail "FAILED"
}

download "$CYGWIN_MAIN/setup-x86.exe"
download "$CYGWIN_MAIN/setup-x86_64.exe"
download "$CYGWIN_MIRROR/x86/setup.xz" "x86"
download "$CYGWIN_MIRROR/x86/setup.xz.sig" "x86"
download "$CYGWIN_MIRROR/x86_64/setup.xz" "x86_64"
download "$CYGWIN_MIRROR/x86_64/setup.xz.sig" "x86_64"