Avoid mesh conflicts between cryptpad and app download site

This commit is contained in:
Bob Mottram 2017-11-09 12:33:11 +00:00
parent 16d5c2b259
commit 33fe1d91d8
1 changed files with 13 additions and 0 deletions

View File

@ -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