Last active
November 10, 2019 17:58
-
-
Save gil-obradors/9fe01b97bee0416e1704a21fa31b8b35 to your computer and use it in GitHub Desktop.
Winbox installer, launcher and web mimo executer for debian/ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
sudo apt-get update | |
sudo apt-get install wine-stable ttf-mscorefonts-installer | |
sudo mkdir -p /opt/winbox/ | |
sudo wget https://mt.lv/winbox64 -O /opt/winbox/winbox.exe | |
sudo chmod 777 /opt/winbox -R | |
cat << EOF | sudo tee /opt/winbox/winbox.desktop | |
[Desktop Entry] | |
Version=1.1 | |
Type=Application | |
Name=Winbox | |
Comment=Winbox routers configuration | |
Icon=/opt/winbox/winbox.png | |
Exec=/usr/bin/winbox %U | |
Actions= | |
MimeType=x-scheme/winbox; | |
Categories=Network;Other; | |
StartupWMClass=winbox.exe | |
EOF | |
wget http://lh4.ggpht.com/Dxzq8sN4X8reDjftYb1OLz8aVU6z1wyg4T3GEusDdJPFyubeHF8IGFqJJg6Yg98rvS8=w300 -O /opt/winbox/winbox.png | |
sudo cp /opt/winbox/winbox.desktop /usr/share/applications/ | |
cat << EOF | sudo tee /usr/bin/winbox | |
#!/bin/bash | |
if [[ \$1 == winbox://* ]] ; | |
then | |
#Acces web | |
parametres=\${1#winbox://} | |
usuari=\`echo $parametres | cut -d':' -f 1\` | |
password=\`echo \$parametres | cut -d':' -f 2 | cut -d'@' -f 1\` | |
host=\`echo \$parametres | cut -d':' -f 2 | cut -d'@' -f 2\` | |
wine /opt/winbox/winbox.exe \$host \$usuari \$password > /dev/null & | |
else | |
wine /opt/winbox/winbox.exe \$1 \$2 \$3 > /dev/null & | |
fi | |
EOF | |
chmod +x /usr/bin/winbox | |
xdg-mime default /opt/winbox/winbox.desktop x-scheme-handler/winbox |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
- chmod +x /usr/bin/winbox
+ sudo chmod +x /usr/bin/winbox