Admin/Windows/Cygwin/setup_server
changeset 68268 38b4d4f39434
child 71385 06bb82e7af2a
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Admin/Windows/Cygwin/setup_server	Thu May 24 22:17:23 2018 +0200
     1.3 @@ -0,0 +1,26 @@
     1.4 +#!/usr/bin/env bash
     1.5 +
     1.6 +CYGWIN_MAIN="https://cygwin.com"
     1.7 +CYGWIN_MIRROR="https://ftp.eq.uc.pt/software/pc/prog/cygwin"
     1.8 +
     1.9 +function fail()
    1.10 +{
    1.11 +  echo "$1" >&2
    1.12 +  exit 2
    1.13 +}
    1.14 +
    1.15 +function download()
    1.16 +{
    1.17 +  local URL="$1"
    1.18 +  local DIR="${2:-.}"
    1.19 +  mkdir -p "$DIR" || fail "Cannot create directory: \"$DIR\""
    1.20 +  echo "Downloading $URL ..."
    1.21 +  curl --fail --silent "$URL" > "$DIR"/"$(basename "$URL")" || fail "FAILED"
    1.22 +}
    1.23 +
    1.24 +download "$CYGWIN_MAIN/setup-x86.exe"
    1.25 +download "$CYGWIN_MAIN/setup-x86_64.exe"
    1.26 +download "$CYGWIN_MIRROR/x86/setup.xz" "x86"
    1.27 +download "$CYGWIN_MIRROR/x86/setup.xz.sig" "x86"
    1.28 +download "$CYGWIN_MIRROR/x86_64/setup.xz" "x86_64"
    1.29 +download "$CYGWIN_MIRROR/x86_64/setup.xz.sig" "x86_64"