Skip to content

Instantly share code, notes, and snippets.

@gil-obradors
Last active November 10, 2019 17:58
Show Gist options
  • Save gil-obradors/9fe01b97bee0416e1704a21fa31b8b35 to your computer and use it in GitHub Desktop.
Save gil-obradors/9fe01b97bee0416e1704a21fa31b8b35 to your computer and use it in GitHub Desktop.
Winbox installer, launcher and web mimo executer for debian/ubuntu
#/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
@sokolster
Copy link

- chmod +x /usr/bin/winbox
+ sudo chmod +x /usr/bin/winbox

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment