OSDN Git Service

rework repo.sh
[instantos/instantOS.git] / repo.sh
1 #!/bin/bash
2
3 ###############################################################################
4 ## add repo containing instantOS programs and required prebuilt aur programs ##
5 ###############################################################################
6
7 echo "adding instantOS repo"
8
9 addrepo() {
10     if ! grep -q "$1"'\.surge\.sh' /etc/pacman.conf; then
11         echo "adding $1 repo"
12         echo "[instant]" >>/etc/pacman.conf
13         echo "SigLevel = Optional TrustAll" >>/etc/pacman.conf
14         echo "Server = http://$1.surge.sh" >>/etc/pacman.conf
15     else
16         echo "instantOS $1 repository already added"
17     fi
18
19 }
20
21 if uname -m | grep -q '^x'; then
22     # default is 64 bit repo
23     addrepo instantos
24 elif uname -m | grep 'arm'; then
25     addrepo instantosarm
26 elif uname -m | grep '^i'; then
27     addrepo instantos32
28 else
29     echo "no suitable repo for architecture found"
30 fi