From eb8dfc1af3181d26dd425fc26cdc4348805d3de6 Mon Sep 17 00:00:00 2001 From: Josh Mudge Date: Sat, 23 Jun 2018 21:57:23 -0600 Subject: [PATCH] Update to check for ARM or x86 and install the correct version. --- install.bash | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/install.bash b/install.bash index 775438e..89e073a 100644 --- a/install.bash +++ b/install.bash @@ -14,7 +14,17 @@ sudo mkdir -p /opt/gitea/ /var/log/gitea sudo chown -R gitea:gitea /opt/gitea/ /var/log/gitea # Download and install gitea -sudo wget -O "/opt/gitea/gitea-$VER" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-arm-7" + + # Check if architecure is x86 and download Gitea +if [ -n "$(uname -a | grep x86_64)" ]; then + sudo wget -O "/opt/gitea/gitea-$VER" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-arm-7" +fi + + # Check if architecure is ARMv7 and download Gitea +if [ -n "$(uname -a | grep armv7l)" ]; then + sudo wget -O "/opt/gitea/gitea-$VER" "https://dl.gitea.io/gitea/$VER/gitea-$VER-linux-arm-7" +fi + sudo chmod +x /opt/gitea/gitea-$VER rm -f /opt/gitea/gitea ln -sf gitea-$VER /opt/gitea/gitea