Updating the social icon when a mesh peer goes online

This commit is contained in:
Bob Mottram 2017-10-28 17:16:08 +01:00
parent 257251b50a
commit 1d929909ba
1 changed files with 8 additions and 4 deletions

View File

@ -966,7 +966,15 @@ if [ \$no_of_users -gt 0 ]; then
fi
fi
add_social_icon=
if [ ! -f /home/$MY_USERNAME/Desktop/social.desktop ]; then
add_social_icon=1
else
if grep -q "Offline" /home/$MY_USERNAME/Desktop/social.desktop; then
add_social_icon=1
fi
fi
if [ $add_social_icon ]; then
echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/social.desktop
echo 'Name=Social' >> /home/$MY_USERNAME/Desktop/social.desktop
echo 'Name[el]=Κοινωνικός' >> /home/$MY_USERNAME/Desktop/social.desktop
@ -997,10 +1005,6 @@ if [ \$no_of_users -gt 0 ]; then
echo 'Categories=Application;' >> /home/$MY_USERNAME/Desktop/social.desktop
chmod +x /home/$MY_USERNAME/Desktop/social.desktop
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/social.desktop
else
if grep -q "Offline" /home/$MY_USERNAME/Desktop/social.desktop; then
sed -i 's|Name=.*|Name=Social|g' /home/$MY_USERNAME/Desktop/social.desktop
fi
fi
#if [ ! -f /home/$MY_USERNAME/Desktop/audio.desktop ]; then