Browse Source

Mesh routing protocol desktop icon

stretch
Bob Mottram 3 years ago
parent
commit
720134ebc5
4 changed files with 107 additions and 0 deletions
  1. + 0
    - 0
      img/avatars/icon_routing.png
  2. BIN
      img/icon_routing.png
  3. + 33
    - 0
      src/freedombone-image-customise
  4. + 74
    - 0
      src/freedombone-mesh-routing

img/icon_protocol.png → img/avatars/icon_routing.png


BIN
img/icon_routing.png

Before After
Width: 130  |  Height: 130  |  Size: 1.1 KiB

+ 33
- 0
src/freedombone-image-customise

@ -1296,6 +1296,39 @@ if [ \$no_of_users -gt 0 ]; then
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/vpn.desktop
fi
if [ ! -f /home/$MY_USERNAME/Desktop/routing.desktop ]; then
echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Name=Routing Protocol' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Name[el]=Πρωτόκολλο δρομολόγησης' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Name[ar]=بروتوكول التوجيه' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Name[ca]=Protocol d'enrutament' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Name[hi]=रूटिंग प्रोटोकॉल' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Name[fr]=Protocole de routage' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Name[de]=Routingprotokoll' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Name[es]=Protocolo de enrutamiento' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Name[it]=Protocollo di routing' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Name[ru]=Протокол маршрутизации' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Name[zh]=路由协议' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Comment=Select the mesh routing protocol' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Comment[el]=Επιλέξτε το πρωτόκολλο δρομολόγησης πλέγματος' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Comment[ar]=حدد بروتوكول توجيه الشبكة' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo "Comment[ca]=Seleccioneu el protocol d'enrutament de malles" >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Comment[hi]=जाल रूटिंग प्रोटोकॉल का चयन करें' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Comment[fr]=Sélectionnez le protocole de routage de maillage' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Comment[de]=Wählen Sie das Mesh-Routing-Protokoll' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Comment[es]=Seleccione el protocolo de enrutamiento de malla' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo "Comment[it]=Seleziona il protocollo di instradamento della mesh" >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Comment[ru]=Выберите протокол маршрутизации сетки' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Comment[zh]=选择网状路由协议' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo "Exec=mate-terminal -e \"/usr/local/bin/${PROJECT_NAME}-mesh-routing\"" >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Icon=/usr/share/$PROJECT_NAME/avatars/icon_routing.png' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Terminal=false' >> /home/$MY_USERNAME/Desktop/routing.desktop
echo 'Categories=Application' >> /home/$MY_USERNAME/Desktop/routing.desktop
chmod +x /home/$MY_USERNAME/Desktop/routing.desktop
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Desktop/routing.desktop
fi
if [ -f /tmp/.ipfs-users ]; then
echo '[Desktop Entry]' > /home/$MY_USERNAME/Desktop/sites.desktop
echo 'Type=Application' >> /home/$MY_USERNAME/Desktop/sites.desktop

+ 74
- 0
src/freedombone-mesh-routing

@ -0,0 +1,74 @@
#!/bin/bash
#
# .---. . .
# | | |
# |--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-.
# | | (.-' (.-' ( | ( )| | | | )( )| | (.-'
# ' ' --' --' -' - -' ' ' -' -' -' ' - --'
#
# Freedom in the Cloud
#
# Select the mesh routing protocol
#
# License
# =======
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
PROJECT_NAME='freedombone'
export TEXTDOMAIN=${PROJECT_NAME}-mesh-routing
export TEXTDOMAINDIR="/usr/share/locale"
source /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-wifi
source /usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-mesh
bmx6_peers=$(avahi-browse -at | grep routing | grep bmx6 | wc -l)
olsr2_peers=$(avahi-browse -at | grep routing | grep olsr2 | wc -l)
data=$(zenity --list 1 $"BMX6 ($bmx6_peers)" 2 $"OLSR2 ($olsr2_peers)" $"Select Mesh Protocol" --column="id" --title $"Mesh Protocol" --column=$"Choose the mesh protocol:" --hide-column=1 --print-column=1 --height=150)
sel=$?
case $sel in
1) exit 1;;
255) exit 1;;
esac
echo '#!/bin/bash' > /tmp/change_routing
echo "echo '$1' > $MESH_DEFAULT_PROTOCOL" >> /tmp/change_routing
echo "echo '$1' > $MESH_CURRENT_PROTOCOL" >> /tmp/change_routing
chmod +x /tmp/change_routing
case $data in
1) sudo /tmp/change_routing 'bmx6'
sudo systemctl stop bmx7
sudo systemctl disable bmx7
sudo systemctl stop olsr2
sudo systemctl disable olsr2
sudo systemctl enable bmx6
sudo systemctl start bmx6
;;
2) sudo /tmp/change_routing 'olsr2'
sudo systemctl stop bmx7
sudo systemctl disable bmx7
sudo systemctl stop bmx6
sudo systemctl disable bmx6
sudo systemctl enable olsr2
sudo systemctl start olsr2
;;
esac
rm /tmp/change_routing
exit 0

Loading…
Cancel
Save