Admin/Windows/Cygwin/setup_server
author wenzelm
Thu May 24 22:17:23 2018 +0200 (22 months ago)
changeset 68268 38b4d4f39434
child 71385 06bb82e7af2a
permissions -rwxr-xr-x
setup server directory for Cygwin quasi-mirror;
wenzelm@68268
     1
#!/usr/bin/env bash
wenzelm@68268
     2
wenzelm@68268
     3
CYGWIN_MAIN="https://cygwin.com"
wenzelm@68268
     4
CYGWIN_MIRROR="https://ftp.eq.uc.pt/software/pc/prog/cygwin"
wenzelm@68268
     5
wenzelm@68268
     6
function fail()
wenzelm@68268
     7
{
wenzelm@68268
     8
  echo "$1" >&2
wenzelm@68268
     9
  exit 2
wenzelm@68268
    10
}
wenzelm@68268
    11
wenzelm@68268
    12
function download()
wenzelm@68268
    13
{
wenzelm@68268
    14
  local URL="$1"
wenzelm@68268
    15
  local DIR="${2:-.}"
wenzelm@68268
    16
  mkdir -p "$DIR" || fail "Cannot create directory: \"$DIR\""
wenzelm@68268
    17
  echo "Downloading $URL ..."
wenzelm@68268
    18
  curl --fail --silent "$URL" > "$DIR"/"$(basename "$URL")" || fail "FAILED"
wenzelm@68268
    19
}
wenzelm@68268
    20
wenzelm@68268
    21
download "$CYGWIN_MAIN/setup-x86.exe"
wenzelm@68268
    22
download "$CYGWIN_MAIN/setup-x86_64.exe"
wenzelm@68268
    23
download "$CYGWIN_MIRROR/x86/setup.xz" "x86"
wenzelm@68268
    24
download "$CYGWIN_MIRROR/x86/setup.xz.sig" "x86"
wenzelm@68268
    25
download "$CYGWIN_MIRROR/x86_64/setup.xz" "x86_64"
wenzelm@68268
    26
download "$CYGWIN_MIRROR/x86_64/setup.xz.sig" "x86_64"