Admin/Windows/Cygwin/setup_server
changeset 68268 38b4d4f39434
child 71385 06bb82e7af2a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Admin/Windows/Cygwin/setup_server	Thu May 24 22:17:23 2018 +0200
@@ -0,0 +1,26 @@
+#!/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"