Quellcode durchsuchen

Architecture check for synapse

Bob Mottram vor 8 Jahren
Ursprung
Commit
54fe76b9d3
1 geänderte Dateien mit 16 neuen und 4 gelöschten Zeilen
  1. 16
    4
      src/freedombone-app-synapse

+ 16
- 4
src/freedombone-app-synapse Datei anzeigen

@@ -30,11 +30,9 @@
30 30
 
31 31
 VARIANTS='full full-vim chat'
32 32
 
33
-IN_DEFAULT_INSTALL=1
34
-SHOW_ON_ABOUT=0
33
+IN_DEFAULT_INSTALL=0
34
+SHOW_ON_ABOUT=1
35 35
 
36
-SYNAPSE_REPO="https://github.com/matrix-org/synapse"
37
-SYNAPSE_COMMIT='4a9055d4465d5d6059612e7c89f2b5774efc0e18'
38 36
 SYNAPSE_PORT=8448
39 37
 SYNAPSE_PASSWORD=
40 38
 SYNAPSE_DIR=/etc/matrix-synapse
@@ -44,6 +42,15 @@ synapse_variables=(ONION_ONLY
44 42
                    SYNAPSE_PASSWORD
45 43
                    DEFAULT_DOMAIN_NAME)
46 44
 
45
+function can_install_synapse {
46
+    check_architecture=$(uname -a)
47
+    if [[ "$check_architecture" == *"amd64"* || "$check_architecture" == *"i386"* ]]; then
48
+        echo "1"
49
+    else
50
+        echo "0"
51
+    fi
52
+}
53
+
47 54
 function remove_user_synapse {
48 55
     remove_username="$1"
49 56
     # TODO
@@ -149,6 +156,11 @@ function remove_synapse {
149 156
 }
150 157
 
151 158
 function install_synapse {
159
+    if [[ "$(can_install_synapse)" == "0" ]]; then
160
+        echo $'Matrix/Synapse can only be installed on i386 or amd64 architectures'
161
+        exit 36734
162
+    fi
163
+
152 164
     if [[ ${ONION_ONLY} == 'no' ]]; then
153 165
         # obtain a cert for the default domain
154 166
         if [[ "$(cert_exists ${DEFAULT_DOMAIN_NAME} pem)" == "0" ]]; then