From: paperbenni Date: Thu, 16 Jul 2020 12:24:07 +0000 (+0200) Subject: rework repo.sh X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=0822167f92306b21d05809cf4d75fe09d3f74b3a;p=instantos%2FinstantOS.git rework repo.sh --- diff --git a/programs/instantsudo b/programs/instantsudo index a431548..f9ed17d 100755 --- a/programs/instantsudo +++ b/programs/instantsudo @@ -4,4 +4,4 @@ SUDO_ASKPASS="$(which instantpassword)" export SUDO_ASKPASS export PASSPROMPT="sudo password for $USER" -sudo -A "$@" +sudo -A $@ diff --git a/repo.sh b/repo.sh index 4235393..3bc5228 100755 --- a/repo.sh +++ b/repo.sh @@ -6,20 +6,25 @@ echo "adding instantOS repo" -if ! uname -m | grep -q '^i'; then - # default is 64 bit repo - if ! grep -q 'instantos\.surge\.sh' /etc/pacman.conf; then +addrepo() { + if ! grep -q "$1"'\.surge\.sh' /etc/pacman.conf; then + echo "adding $1 repo" echo "[instant]" >>/etc/pacman.conf echo "SigLevel = Optional TrustAll" >>/etc/pacman.conf - echo "Server = http://instantos.surge.sh" >>/etc/pacman.conf + echo "Server = http://$1.surge.sh" >>/etc/pacman.conf else - echo "instantOS repository already added" + echo "instantOS $1 repository already added" fi + +} + +if uname -m | grep -q '^x'; then + # default is 64 bit repo + addrepo instantos +elif uname -m | grep 'arm'; then + addrepo instantosarm +elif uname -m | grep '^i'; then + addrepo instantos32 else - # 32 bit has a seperate repo (obviously) - if ! grep -q 'instantos\.surge\.sh' /etc/pacman.conf; then - echo "[instant]" >>/etc/pacman.conf - echo "SigLevel = Optional TrustAll" >>/etc/pacman.conf - echo "Server = http://instantos32.surge.sh" >>/etc/pacman.conf - fi + echo "no suitable repo for architecture found" fi