setup server directory for Cygwin quasi-mirror;
authorwenzelm
Thu, 24 May 2018 22:17:23 +0200
changeset 68270 38b4d4f39434
parent 68269 6a29709906c6
child 68271 5ff0ccc74884
setup server directory for Cygwin quasi-mirror;
Admin/Windows/Cygwin/setup_server
--- /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"