Ah, this works:

"""
#!/bin/bash

REQUIRED_CONNECTION_NAME="Example"
VPN_CONNECTION_NAME="Example VPN"
OWNER_OF_VPN_SECRET="exampleuser" # Username of the owner of the keyring with 
the VPN credentials

activ_con=$(nmcli con status | grep "${REQUIRED_CONNECTION_NAME}")
activ_vpn=$(nmcli con status | grep "${VPN_CONNECTION_NAME}")

if [ "${activ_con}" -a ! "${activ_vpn}" ];
then
    su ${OWNER_OF_VPN_SECRET} -c "nmcli con up id \"${VPN_CONNECTION_NAME}\""
fi
"""

So it is an access rights issue.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/906290

Title:
  PPTP: Connecting from GUI works, but not automatically from command-
  line dispatcher script

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/network-manager-pptp/+bug/906290/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to