|
@@ -894,6 +894,7 @@ function configure_user_interface {
|
894
|
894
|
# Produce a text file on the desktop listing users on the mesh
|
895
|
895
|
cat <<EOF > $rootdir/usr/bin/list-tox-users
|
896
|
896
|
#!/bin/bash
|
|
897
|
+ethernet_connected=$(cat /sys/class/net/eth0/carrier)
|
897
|
898
|
users_list=\$(lstox | awk -F ' ' '{\$1=""; print \$0}' | sed -e 's/^[[:space:]]*//' | sort -d | uniq)
|
898
|
899
|
if [ ! \$users_list ]; then
|
899
|
900
|
no_of_users=0
|
|
@@ -1003,6 +1004,26 @@ if [ \$no_of_users -gt 0 ]; then
|
1003
|
1004
|
chmod +x /home/$MY_USERNAME/Desktop/tox.desktop
|
1004
|
1005
|
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/tox.desktop
|
1005
|
1006
|
fi
|
|
1007
|
+
|
|
1008
|
+ # If ethernet is connected then add the invite icon to help enable
|
|
1009
|
+ # SSB nat traversal
|
|
1010
|
+ if [[ "$ethernet_connected" != "0" ]]; then
|
|
1011
|
+ if [ ! -f /home/$MY_USERNAME/Desktop/invite.desktop ]; then
|
|
1012
|
+ echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/invite.desktop
|
|
1013
|
+ echo 'Version=1.0' >> /home/$MY_USERNAME/Desktop/invite.desktop
|
|
1014
|
+ echo 'Name=Create Invite' >> /home/$MY_USERNAME/Desktop/invite.desktop
|
|
1015
|
+ echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/invite.desktop
|
|
1016
|
+ echo 'Comment=Create an invite for Patchwork or Ferment' >> /home/$MY_USERNAME/Desktop/invite.desktop
|
|
1017
|
+ echo 'Exec=mate-terminal -e freedombone-mesh-invite' >> /home/$MY_USERNAME/Desktop/invite.desktop
|
|
1018
|
+ echo 'Icon=/usr/share/freedombone/avatars/invite.png' >> /home/$MY_USERNAME/Desktop/invite.desktop
|
|
1019
|
+ echo 'Terminal=false' >> /home/$MY_USERNAME/Desktop/invite.desktop
|
|
1020
|
+ echo 'Categories=Application;' >> /home/$MY_USERNAME/Desktop/invite.desktop
|
|
1021
|
+ fi
|
|
1022
|
+ else
|
|
1023
|
+ if [ -f /home/$MY_USERNAME/Desktop/invite.desktop ]; then
|
|
1024
|
+ rm /home/$MY_USERNAME/Desktop/invite.desktop
|
|
1025
|
+ fi
|
|
1026
|
+ fi
|
1006
|
1027
|
else
|
1007
|
1028
|
if [ -f /tmp/Users.txt ]; then
|
1008
|
1029
|
rm /tmp/Users.txt
|
|
@@ -1031,6 +1052,13 @@ else
|
1031
|
1052
|
#fi
|
1032
|
1053
|
pkill qtox
|
1033
|
1054
|
fi
|
|
1055
|
+
|
|
1056
|
+ # If there is no ethernet then remove the invite icon
|
|
1057
|
+ if [[ "$ethernet_connected" == "0" ]]; then
|
|
1058
|
+ if [ -f /home/$MY_USERNAME/Desktop/invite.desktop ]; then
|
|
1059
|
+ rm /home/$MY_USERNAME/Desktop/invite.desktop
|
|
1060
|
+ fi
|
|
1061
|
+ fi
|
1034
|
1062
|
fi
|
1035
|
1063
|
EOF
|
1036
|
1064
|
chroot "$rootdir" /bin/chown $MY_USERNAME:$MY_USERNAME /usr/bin/list-tox-users
|