瀏覽代碼

Avoid mesh conflicts between cryptpad and app download site

Bob Mottram 7 年之前
父節點
當前提交
33fe1d91d8
共有 1 個檔案被更改,包括 13 行新增0 行删除
  1. 13
    0
      src/freedombone-mesh-batman

+ 13
- 0
src/freedombone-mesh-batman 查看文件

261
     if [ ! -d /var/www/html ]; then
261
     if [ ! -d /var/www/html ]; then
262
         return
262
         return
263
     fi
263
     fi
264
+    # Don't go straight to cryptpad when navigating to the peer's IP address
265
+    if [ -L /etc/nginx/sites-enabled/cryptpad ]; then
266
+        rm /etc/nginx/sites-enabled/cryptpad
267
+        systemctl restart nginx
268
+    fi
264
     cp /root/$PROJECT_NAME/website/EN/meshindex.html /var/www/html/index.html
269
     cp /root/$PROJECT_NAME/website/EN/meshindex.html /var/www/html/index.html
265
     if [ ! -f /var/www/html/ssb.apk ]; then
270
     if [ ! -f /var/www/html/ssb.apk ]; then
266
         cp /root/$PROJECT_NAME/image_build/mesh_apps/ssb.apk /var/www/html/ssb.apk
271
         cp /root/$PROJECT_NAME/image_build/mesh_apps/ssb.apk /var/www/html/ssb.apk
361
         systemctl enable hostapd
366
         systemctl enable hostapd
362
         systemctl restart hostapd
367
         systemctl restart hostapd
363
         mesh_create_app_downloads_page
368
         mesh_create_app_downloads_page
369
+    else
370
+        # Recreate the cryptpad symlink
371
+        if [ -f /etc/nginx/sites-available/cryptpad ]; then
372
+            if [ ! -L /etc/nginx/sites-enabled/cryptpad ]; then
373
+                ln -s /etc/nginx/sites-available/cryptpad /etc/nginx/sites-enabled/cryptpad
374
+                systemctl restart nginx
375
+            fi
376
+        fi
364
     fi
377
     fi
365
 
378
 
366
     iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
379
     iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT