From 33fe1d91d8ee6dfab08879b160068ea79de93f00 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 9 Nov 2017 12:33:11 +0000 Subject: [PATCH] Avoid mesh conflicts between cryptpad and app download site --- src/freedombone-mesh-batman | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/freedombone-mesh-batman b/src/freedombone-mesh-batman index 8152dd45..92e20628 100755 --- a/src/freedombone-mesh-batman +++ b/src/freedombone-mesh-batman @@ -261,6 +261,11 @@ function mesh_create_app_downloads_page { if [ ! -d /var/www/html ]; then return fi + # Don't go straight to cryptpad when navigating to the peer's IP address + if [ -L /etc/nginx/sites-enabled/cryptpad ]; then + rm /etc/nginx/sites-enabled/cryptpad + systemctl restart nginx + fi cp /root/$PROJECT_NAME/website/EN/meshindex.html /var/www/html/index.html if [ ! -f /var/www/html/ssb.apk ]; then cp /root/$PROJECT_NAME/image_build/mesh_apps/ssb.apk /var/www/html/ssb.apk @@ -361,6 +366,14 @@ function start { systemctl enable hostapd systemctl restart hostapd mesh_create_app_downloads_page + else + # Recreate the cryptpad symlink + if [ -f /etc/nginx/sites-available/cryptpad ]; then + if [ ! -L /etc/nginx/sites-enabled/cryptpad ]; then + ln -s /etc/nginx/sites-available/cryptpad /etc/nginx/sites-enabled/cryptpad + systemctl restart nginx + fi + fi fi iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT