Admin/Windows/Cygwin/setup_server
author wenzelm
Thu, 16 Jan 2020 14:07:28 +0100
changeset 71385 06bb82e7af2a
parent 68268 38b4d4f39434
child 77052 86ace3c45837
permissions -rwxr-xr-x
updated to current cygwin, after 3.1.2-1 from 21-Dec-2019;

#!/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_64.exe"
download "$CYGWIN_MIRROR/x86_64/setup.xz" "x86_64"
download "$CYGWIN_MIRROR/x86_64/setup.xz.sig" "x86_64"