Pārlūkot izejas kodu

fix: check for 32 bits before installing/starting

Nicolas Meienberger 2 gadi atpakaļ
vecāks
revīzija
6e61e31440
2 mainītis faili ar 13 papildinājumiem un 6 dzēšanām
  1. 9 0
      scripts/install.sh
  2. 4 6
      scripts/start.sh

+ 9 - 0
scripts/install.sh

@@ -4,6 +4,15 @@ set -o nounset
 set -o pipefail
 
 echo "Installing runtipi..."
+
+ARCHITECTURE="$(uname -m)"
+# Not supported on 32 bits systems
+if [[ "$ARCHITECTURE" == "armv7"* ]] || [[ "$ARCHITECTURE" == "i686" ]] || [[ "$ARCHITECTURE" == "i386" ]]; then
+    echo "runtipi is not supported on 32 bits systems"
+    exit 1
+fi
+
+
 LATEST_VERSION=$(curl -s https://api.github.com/repos/meienberger/runtipi/releases/latest | grep tag_name | cut -d '"' -f4)
 
 ### --------------------------------

+ 4 - 6
scripts/start.sh

@@ -43,7 +43,7 @@ NGINX_PORT_SSL=443
 DOMAIN=tipi.localhost
 SED_ROOT_FOLDER="$(echo "$ROOT_FOLDER" | sed 's/\//\\\//g')"
 DNS_IP="9.9.9.9" # Default to Quad9 DNS
-ARCHITECTURE="$(uname -m)"
+ARCHITECTURE="$(uname -m | tr '[:upper:]' '[:lower:]')"
 apps_repository="https://github.com/meienberger/runtipi-appstore"
 REPO_ID="$("${ROOT_FOLDER}"/scripts/git.sh get_hash ${apps_repository})"
 APPS_REPOSITORY_ESCAPED="$(echo ${apps_repository} | sed 's/\//\\\//g')"
@@ -59,17 +59,15 @@ STORAGE_PATH_ESCAPED="$(echo "${storage_path}" | sed 's/\//\\\//g')"
 REDIS_HOST=tipi-redis
 INTERNAL_IP=
 
-if [[ "$ARCHITECTURE" == "aarch64" ]]; then
+if [[ "$ARCHITECTURE" == "aarch64" ]] || [[ "$ARCHITECTURE" == "armv8"* ]]; then
   ARCHITECTURE="arm64"
-elif [[ "$ARCHITECTURE" == "armv7"* || "$ARCHITECTURE" == "armv8"* ]]; then
-  ARCHITECTURE="arm"
 elif [[ "$ARCHITECTURE" == "x86_64" ]]; then
   ARCHITECTURE="amd64"
 fi
 
 # If none of the above conditions are met, the architecture is not supported
-if [[ "$ARCHITECTURE" != "arm64" ]] && [[ "$ARCHITECTURE" != "arm" ]] && [[ "$ARCHITECTURE" != "amd64" ]]; then
-  echo "Architecture ${ARCHITECTURE} not supported!"
+if [[ "$ARCHITECTURE" != "arm64" ]] && [[ "$ARCHITECTURE" != "amd64" ]]; then
+  echo "Architecture ${ARCHITECTURE} not supported if you think this is a mistake, please open an issue on GitHub."
   exit 1
 fi