Hello
I have the OpenVPN client installed with the GUI thats next to the clock where you right click on the network connections, it appears, and you connect to the VPN. Now, I want that after I click on it to make a connection, and the connection is successful, to run a script Ive made as root (so it doesnt ask me for my password and it is automatic). How can I configure this?
Thank you
Ubuntu: Autoconnect OpenVPN client (GUI) THEN run a script
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
-
- OpenVPN User
- Posts: 46
- Joined: Tue Jun 26, 2012 9:04 am
-
- OpenVPN User
- Posts: 46
- Joined: Tue Jun 26, 2012 9:04 am
Re: Ubuntu: Autoconnect OpenVPN client (GUI) THEN run a scri
Someone has had to do this one time at least...
-
- OpenVPN User
- Posts: 46
- Joined: Tue Jun 26, 2012 9:04 am
Re: Ubuntu: Autoconnect OpenVPN client (GUI) THEN run a scri
Found this:
https://wiki.archlinux.org/index.php/Ne ... dispatcher
Do I just throw the script inside the folder?
https://wiki.archlinux.org/index.php/Ne ... dispatcher
Do I just throw the script inside the folder?
-
- OpenVPN User
- Posts: 46
- Joined: Tue Jun 26, 2012 9:04 am
Re: Ubuntu: Autoconnect OpenVPN client (GUI) THEN run a scri
Ok Im getting somewhere....
When I throw a script inside there Im running something like this:
#!/bin/sh
interface=$1 status=$2
case $status in
up)
echo hi
;;
down)
;;
esac
Before that case, Im going to do a "if" that searches for the name of my vpn which I would get using
nmcli con status
Lets say my vpn is called "helloworld"
How would I do a (pseudocode):
If in nmcli con status I find the text "helloworld" do
actions
end if
In a shell script?
When I throw a script inside there Im running something like this:
#!/bin/sh
interface=$1 status=$2
case $status in
up)
echo hi
;;
down)
;;
esac
Before that case, Im going to do a "if" that searches for the name of my vpn which I would get using
nmcli con status
Lets say my vpn is called "helloworld"
How would I do a (pseudocode):
If in nmcli con status I find the text "helloworld" do
actions
end if
In a shell script?
-
- OpenVPN User
- Posts: 46
- Joined: Tue Jun 26, 2012 9:04 am
Re: Ubuntu: Autoconnect OpenVPN client (GUI) THEN run a scri
Again, I find it hard to believe that noone has even thought of trying something like this...