Admin/Windows/Cygwin/setup_server
author wenzelm
Thu, 26 Oct 2023 12:36:19 +0200
changeset 78848 26a43785590b
parent 78304 e4b57eea7f86
permissions -rwxr-xr-x
proper support for SSH;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
68268
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
     1
#!/usr/bin/env bash
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
     2
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
     3
CYGWIN_MAIN="https://cygwin.com"
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
     4
CYGWIN_MIRROR="https://ftp.eq.uc.pt/software/pc/prog/cygwin"
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
     5
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
     6
function fail()
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
     7
{
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
     8
  echo "$1" >&2
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
     9
  exit 2
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
    10
}
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
    11
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
    12
function download()
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
    13
{
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
    14
  local URL="$1"
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
    15
  local DIR="${2:-.}"
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
    16
  mkdir -p "$DIR" || fail "Cannot create directory: \"$DIR\""
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
    17
  echo "Downloading $URL ..."
77052
86ace3c45837 more uniform options for "curl", following lib/Tools/components;
wenzelm
parents: 71385
diff changeset
    18
  curl --fail --silent --location "$URL" > "$DIR"/"$(basename "$URL")" || fail "FAILED"
68268
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
    19
}
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
    20
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
    21
download "$CYGWIN_MAIN/setup-x86_64.exe"
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
    22
download "$CYGWIN_MIRROR/x86_64/setup.xz" "x86_64"
38b4d4f39434 setup server directory for Cygwin quasi-mirror;
wenzelm
parents:
diff changeset
    23
download "$CYGWIN_MIRROR/x86_64/setup.xz.sig" "x86_64"
78304
e4b57eea7f86 update cygwin for Isabelle2023 -- somewhere after cygwin 3.4.0-1 (see https://cygwin.com/pipermail/cygwin-announce/2022-December/010821.html);
wenzelm
parents: 77052
diff changeset
    24
download "$CYGWIN_MIRROR/x86_64/setup.zst" "x86_64"
e4b57eea7f86 update cygwin for Isabelle2023 -- somewhere after cygwin 3.4.0-1 (see https://cygwin.com/pipermail/cygwin-announce/2022-December/010821.html);
wenzelm
parents: 77052
diff changeset
    25
download "$CYGWIN_MIRROR/x86_64/setup.zst.sig" "x86_64"