mirror of
				https://github.com/vdsm/virtual-dsm.git
				synced 2025-11-04 17:04:52 +08:00 
			
		
		
		
	Fallback for installer
This commit is contained in:
		
							parent
							
								
									4903ff487c
								
							
						
					
					
						commit
						c264c3a3e7
					
				@ -15,6 +15,13 @@ if [ -z "$URL" ]; then
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Check if running with interactive TTY or redirected to docker log
 | 
				
			||||||
 | 
					if [ -t 1 ]; then
 | 
				
			||||||
 | 
					  PROGRESS="--progress=bar:noscroll"
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					  PROGRESS="--progress=dot:giga"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
BASE=$(basename "$URL" .pat)
 | 
					BASE=$(basename "$URL" .pat)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
rm -f "$STORAGE"/"$BASE".pat
 | 
					rm -f "$STORAGE"/"$BASE".pat
 | 
				
			||||||
@ -32,16 +39,33 @@ rm -rf "$TMP" && mkdir -p "$TMP"
 | 
				
			|||||||
if [ ! -f "${RDC}" ]; then
 | 
					if [ ! -f "${RDC}" ]; then
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  RD="$TMP/rd.gz"
 | 
					  RD="$TMP/rd.gz"
 | 
				
			||||||
  info "Install: Downloading installer..." 
 | 
					  info "Install: Downloading installer..."
 | 
				
			||||||
  LOC="$DL/release/7.0.1/42218/DSM_VirtualDSM_42218.pat"
 | 
					  LOC="$DL/release/7.0.1/42218/DSM_VirtualDSM_42218.pat"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  { curl -r 65627648-71021836 -sfk -o "$RD" "$LOC"; rc=$?; } || :
 | 
					  { curl -r 65627648-71021836 -sfk -o "$RD" "$LOC"; rc=$?; } || :
 | 
				
			||||||
  (( rc != 0 )) && error "Failed to download $LOC, reason: $rc" && exit 60
 | 
					  (( rc != 0 )) && error "Failed to download $LOC, reason: $rc" && exit 60
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  SUM=$(md5sum "$RD" | cut -f 1 -d " ")
 | 
					  SUM=$(md5sum "$RD" | cut -f 1 -d " ")
 | 
				
			||||||
 | 
					  VERIFY="ab399db750f88ac7aa88f608f2b8651c"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if [ "$SUM" != "$VERIFY" ]; then
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    PAT="/dsm.pat"
 | 
				
			||||||
 | 
					    rm "$RD"
 | 
				
			||||||
 | 
					    rm -f "$PAT"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    { wget "$LOC" -O "$PAT" -q --no-check-certificate --show-progress "$PROGRESS"; rc=$?; } || :
 | 
				
			||||||
 | 
					    (( rc != 0 )) && error "Failed to download $LOC, reason: $rc" && exit 60
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    tar --extract --file="$PAT" --directory="$TMP/." rd.gz
 | 
				
			||||||
 | 
					    rm "$PAT"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    SUM=$(md5sum "$RD" | cut -f 1 -d " ")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if [ "$SUM" != "$VERIFY" ]; then
 | 
				
			||||||
 | 
					      error "Invalid download location (checksum $SUM)" && exit 61
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if [ "$SUM" != "ab399db750f88ac7aa88f608f2b8651c" ]; then
 | 
					 | 
				
			||||||
    error "Invalid download location (checksum $SUM)" && exit 61
 | 
					 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  cp "$RD" "$RDC"
 | 
					  cp "$RD" "$RDC"
 | 
				
			||||||
@ -68,13 +92,6 @@ info "Install: Downloading $(basename "$URL")..."
 | 
				
			|||||||
PAT="/$BASE.pat"
 | 
					PAT="/$BASE.pat"
 | 
				
			||||||
rm -f "$PAT"
 | 
					rm -f "$PAT"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Check if running with interactive TTY or redirected to docker log
 | 
					 | 
				
			||||||
if [ -t 1 ]; then
 | 
					 | 
				
			||||||
  PROGRESS="--progress=bar:noscroll"
 | 
					 | 
				
			||||||
else
 | 
					 | 
				
			||||||
  PROGRESS="--progress=dot:giga"
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
{ wget "$URL" -O "$PAT" -q --no-check-certificate --show-progress "$PROGRESS"; rc=$?; } || :
 | 
					{ wget "$URL" -O "$PAT" -q --no-check-certificate --show-progress "$PROGRESS"; rc=$?; } || :
 | 
				
			||||||
(( rc != 0 )) && error "Failed to download $URL, reason: $rc" && exit 69
 | 
					(( rc != 0 )) && error "Failed to download $URL, reason: $rc" && exit 69
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user