Admin/Windows/Cygwin/setup_server
changeset 68268 38b4d4f39434
child 71385 06bb82e7af2a
equal deleted inserted replaced
68267:6a29709906c6 68268:38b4d4f39434
       
     1 #!/usr/bin/env bash
       
     2 
       
     3 CYGWIN_MAIN="https://cygwin.com"
       
     4 CYGWIN_MIRROR="https://ftp.eq.uc.pt/software/pc/prog/cygwin"
       
     5 
       
     6 function fail()
       
     7 {
       
     8   echo "$1" >&2
       
     9   exit 2
       
    10 }
       
    11 
       
    12 function download()
       
    13 {
       
    14   local URL="$1"
       
    15   local DIR="${2:-.}"
       
    16   mkdir -p "$DIR" || fail "Cannot create directory: \"$DIR\""
       
    17   echo "Downloading $URL ..."
       
    18   curl --fail --silent "$URL" > "$DIR"/"$(basename "$URL")" || fail "FAILED"
       
    19 }
       
    20 
       
    21 download "$CYGWIN_MAIN/setup-x86.exe"
       
    22 download "$CYGWIN_MAIN/setup-x86_64.exe"
       
    23 download "$CYGWIN_MIRROR/x86/setup.xz" "x86"
       
    24 download "$CYGWIN_MIRROR/x86/setup.xz.sig" "x86"
       
    25 download "$CYGWIN_MIRROR/x86_64/setup.xz" "x86_64"
       
    26 download "$CYGWIN_MIRROR/x86_64/setup.xz.sig" "x86_64"