Trying to create a Desktop File from which I can launch my openvpn connection, but no luck so far.
What I have:
david@david-x1:~/Schreibtisch$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.10
Release: 18.10
Codename: cosmic
What I did:
Created a shell script that starts the openvpn connection in /home/david/vpn and it looks like this:
#!/bin/bash
sudo openvpn --config Zurich.ovpn
Permission: -rwxrwxr-x 1 david david 46 Feb 10 23:18 vpnswiss.sh
This is working fine. When I execute the script by typing ./vpnswiss.sh
Im asked for the sudo pw and th VPN tunnel will come up.
My Desktop File:
[Desktop Entry]
Name=VPN CH
Exec=bash -c '/home/david/vpn/vpnswiss.sh'
Icon=/home/david/vpn/vpnswiss.png
Terminal=true
Type=Application
Version=1.0
I also tried
Exec=/home/david/vpn/vpnswiss.sh
or
Exec=bash -c 'sudo openvpn --config Zurich.ovpn'
but it doesnt work. The Desktop File shows up on my desktop just fine, including the correct icon and when I run other applications for test purposes like for example Exec=firefox
or Exec=bash -c 'sudo firefox'
, it works instantly. But as soon as Im trying to run openvpn, the terminal window just vanishes after I entered the sudo password. The script is not executed "silently", because when I check ifconfig a few seconds later, theres no VPN connection up.
Any ideas on what I am missing here? Thanks a lot in advance!