OSDN Git Service

add multiple mirrors
authorpaperbenni <paperbenni@gmail.com>
Thu, 30 Jul 2020 10:05:31 +0000 (12:05 +0200)
committerpaperbenni <paperbenni@gmail.com>
Thu, 30 Jul 2020 10:05:31 +0000 (12:05 +0200)
mirrors/amd64 [new file with mode: 0644]
mirrors/arm [new file with mode: 0644]
mirrors/i386 [new file with mode: 0644]
repo.sh

diff --git a/mirrors/amd64 b/mirrors/amd64
new file mode 100644 (file)
index 0000000..826de45
--- /dev/null
@@ -0,0 +1,8 @@
+# mirror list for isntantOS amd64
+
+# official main repo
+Server = http://repo.instantos.io
+
+Server = https://instantos.file.coffee
+Server = https://instantos.netlify.app
+Server = https://instantos.web.app
\ No newline at end of file
diff --git a/mirrors/arm b/mirrors/arm
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/mirrors/i386 b/mirrors/i386
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/repo.sh b/repo.sh
index 3bc5228..dd20561 100755 (executable)
--- a/repo.sh
+++ b/repo.sh
@@ -7,11 +7,16 @@
 echo "adding instantOS repo"
 
 addrepo() {
-    if ! grep -q "$1"'\.surge\.sh' /etc/pacman.conf; then
+    if ! grep -q '\[instant\]' /etc/pacman.conf; then
         echo "adding $1 repo"
         echo "[instant]" >>/etc/pacman.conf
         echo "SigLevel = Optional TrustAll" >>/etc/pacman.conf
-        echo "Server = http://$1.surge.sh" >>/etc/pacman.conf
+        echo "Include = /etc/pacman.d/instantmirrorlist" >>/etc/pacman.conf
+        if [ -e /usr/share/instantutils/mirrors/"$1" ]; then
+            cat /usr/share/instantutils/mirrors/"$1" >/etc/pacman.d/instantmirrorlist
+        else
+            curl -s https://raw.githubusercontent.com/instantOS/instantOS/master/mirrors/"$1" >/etc/pacman.d/instantmirrorlist
+        fi
     else
         echo "instantOS $1 repository already added"
     fi
@@ -20,10 +25,14 @@ addrepo() {
 
 if uname -m | grep -q '^x'; then
     # default is 64 bit repo
-    addrepo instantos
+    addrepo amd64
 elif uname -m | grep 'arm'; then
+    echo "no official arm repo yet"
+    exit
     addrepo instantosarm
 elif uname -m | grep '^i'; then
+    echo "no official 32 bit repo yet"
+    exit
     addrepo instantos32
 else
     echo "no suitable repo for architecture found"