Hide cryptpad icon if mesh hotspot is enabled

This commit is contained in:
Bob Mottram 2017-11-09 18:54:40 +00:00
parent 33fe1d91d8
commit 14abffaf27
2 changed files with 45 additions and 24 deletions

View File

@ -927,30 +927,32 @@ if [ \$no_of_users -gt 0 ]; then
chmod +x /home/$MY_USERNAME/Desktop/Users.desktop
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/Users.desktop
if [ ! -f /home/$MY_USERNAME/Desktop/cryptpad.desktop ]; then
echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Name=CryptPad' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment=Realtime collaborative editing of documents' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[el]=Συνεργατική επεξεργασία εγγράφων σε πραγματικό χρόνο' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[ar]=في الوقت الحقيقي التحرير التعاوني للوثائق' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[ca]=Edició col·laborativa en temps real de documents' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[hi]=दस्तावेज़ों का रीयलटाइम सहयोगी संपादन' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[fr]=Edition collaborative en temps réel de documents' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[de]=Kollaboratives Echtzeit-Editing von Dokumenten' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[es]=Edición colaborativa en tiempo real de documentos' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[it]=Editing collaborativo di documenti in tempo reale' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[ru]=Совместное редактирование документов в режиме реального времени' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[zh]=实时协同编辑文件' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo "Exec=$BROWSER http://\${HOSTNAME}.local" >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo "Icon=/usr/share/$PROJECT_NAME/avatars/icon_cryptpad.png" >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Terminal=false' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Categories=Application;' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
chmod +x /home/$MY_USERNAME/Desktop/cryptpad.desktop
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/cryptpad.desktop
else
if ! grep -q "\${HOSTNAME}.local" /home/$MY_USERNAME/Desktop/cryptpad.desktop; then
sed -i "s|Exec=.*|Exec=$BROWSER http://\${HOSTNAME}.local|g" /home/$MY_USERNAME/Desktop/cryptpad.desktop
if [ ! -f /home/$MY_USERNAME/.cryptpad.desktop ]; then
if [ ! -f /home/$MY_USERNAME/Desktop/cryptpad.desktop ]; then
echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Name=CryptPad' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment=Realtime collaborative editing of documents' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[el]=Συνεργατική επεξεργασία εγγράφων σε πραγματικό χρόνο' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[ar]=في الوقت الحقيقي التحرير التعاوني للوثائق' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[ca]=Edició col·laborativa en temps real de documents' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[hi]=दस्तावेज़ों का रीयलटाइम सहयोगी संपादन' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[fr]=Edition collaborative en temps réel de documents' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[de]=Kollaboratives Echtzeit-Editing von Dokumenten' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[es]=Edición colaborativa en tiempo real de documentos' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[it]=Editing collaborativo di documenti in tempo reale' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[ru]=Совместное редактирование документов в режиме реального времени' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Comment[zh]=实时协同编辑文件' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo "Exec=$BROWSER http://\${HOSTNAME}.local" >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo "Icon=/usr/share/$PROJECT_NAME/avatars/icon_cryptpad.png" >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Terminal=false' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
echo 'Categories=Application;' >> /home/$MY_USERNAME/Desktop/cryptpad.desktop
chmod +x /home/$MY_USERNAME/Desktop/cryptpad.desktop
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/cryptpad.desktop
else
if ! grep -q "\${HOSTNAME}.local" /home/$MY_USERNAME/Desktop/cryptpad.desktop; then
sed -i "s|Exec=.*|Exec=$BROWSER http://\${HOSTNAME}.local|g" /home/$MY_USERNAME/Desktop/cryptpad.desktop
fi
fi
fi

View File

@ -264,8 +264,18 @@ function mesh_create_app_downloads_page {
# 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
ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
if [ -d /etc/cryptpad ]; then
systemctl stop cryptpad
systemctl disable cryptpad
fi
systemctl restart nginx
fi
# Don't show the cryptpad icon on the desktop
if [ -f /home/fbone/Desktop/cryptpad.desktop ]; then
mv /home/fbone/Desktop/cryptpad.desktop /home/fbone/.cryptpad.desktop
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
@ -369,11 +379,20 @@ function start {
else
# Recreate the cryptpad symlink
if [ -f /etc/nginx/sites-available/cryptpad ]; then
if [ -L /etc/nginx/sites-enabled/cryptpad ]; then
rm /etc/nginx/sites-enabled/default
fi
systemctl enable cryptpad
systemctl start cryptpad
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
if [ -f /home/fbone/.cryptpad.desktop ]; then
mv /home/fbone/.cryptpad.desktop /home/fbone/Desktop/cryptpad.desktop
fi
fi
iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT