Jakob Borg 13 лет назад
Родитель
Сommit
ee9dde5a39
2 измененных файлов с 9 добавлено и 3 удалено
  1. 2 1
      README.md
  2. 7 2
      platform-upgrade

+ 2 - 1
README.md

@@ -6,7 +6,8 @@ A script to simplify upgrades of USB booted SmartOS installations.
 Installation
 ------------
 
-Drop the script in `/opt/local/bin` on the GZ.
+Drop the script in `/opt/local/bin` on the GZ. Edit it to select the
+desired mirror/download site at the top.
 
 Usage
 -----

+ 7 - 2
platform-upgrade

@@ -1,4 +1,9 @@
 #!/bin/bash
+
+# Select the official site or any of the mirrors by commenting out the correct line
+
+# MIRROR=https://download.joyent.com/pub/iso/
+MIRROR=http://smartos.nym.se/
        
 TMP=$(mktemp -d)
 cd $TMP || exit -1
@@ -29,7 +34,7 @@ else
 fi     
        
 echo -n "Downloading latest platform..."
-if ( !  curl -sk -o platform-latest.tgz https://download.joyent.com/pub/iso/platform-latest.tgz ) ; then
+if ( !  curl -sk -o platform-latest.tgz $MIRROR/platform-latest.tgz ) ; then
         echo " failed"
         exit -1
 else
@@ -37,7 +42,7 @@ else
 fi
        
 echo -n "Verifying checksum..."
-curl -sk https://download.joyent.com/pub/iso/md5sums.txt \
+curl -sk $MIRROR/md5sums.txt \
         | grep platform-latest.tgz \
         | awk '{print $1}' > expected.md5
 openssl md5 platform-latest.tgz | awk '{print $2}' > actual.md5