Parcourir la source

Architecture check for synapse

Bob Mottram il y a 8 ans
Parent
révision
54fe76b9d3
1 fichiers modifiés avec 16 ajouts et 4 suppressions
  1. 16
    4
      src/freedombone-app-synapse

+ 16
- 4
src/freedombone-app-synapse Voir le fichier

30
 
30
 
31
 VARIANTS='full full-vim chat'
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
 SYNAPSE_PORT=8448
36
 SYNAPSE_PORT=8448
39
 SYNAPSE_PASSWORD=
37
 SYNAPSE_PASSWORD=
40
 SYNAPSE_DIR=/etc/matrix-synapse
38
 SYNAPSE_DIR=/etc/matrix-synapse
44
                    SYNAPSE_PASSWORD
42
                    SYNAPSE_PASSWORD
45
                    DEFAULT_DOMAIN_NAME)
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
 function remove_user_synapse {
54
 function remove_user_synapse {
48
     remove_username="$1"
55
     remove_username="$1"
49
     # TODO
56
     # TODO
149
 }
156
 }
150
 
157
 
151
 function install_synapse {
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
     if [[ ${ONION_ONLY} == 'no' ]]; then
164
     if [[ ${ONION_ONLY} == 'no' ]]; then
153
         # obtain a cert for the default domain
165
         # obtain a cert for the default domain
154
         if [[ "$(cert_exists ${DEFAULT_DOMAIN_NAME} pem)" == "0" ]]; then
166
         if [[ "$(cert_exists ${DEFAULT_DOMAIN_NAME} pem)" == "0" ]]; then