Comment 31 for bug 280571

Revision history for this message
Felix (apoapo) wrote :

Johannes Storm wrote a very tiny script. Is anyone able to prepare the patch here? I don't know where to start in the sources. NM is much to complicated for me to start helping with patches :(

For the meantime, his script for /etc/NetworkManager/dispatcher.d/:

#! /bin/bash

REQUIRED_CONNECTION_NAME="<Connection1>"
VPN_CONNECTION_NAME="<VpnConnection1>"

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
    nmcli con up id "${VPN_CONNECTION_NAME}"
fi