I've tried a dozen different searches, but nothing has turned up exactly what I need. Here's my use case:
[Minimally at boot, bonus if dynamically]
- If Ethernet has (or obtains) link, configure Ethernet up and wifi down (so no
bonding, no prioritizing Ethernet over wifi that requires wifi to also be up):
- Stop openvpn-server@myvpn .
- Bring wlan0 down, and disable it.
- Bring eth0 up.
- If Ethernet does not have (or loses) link:
- Enable wlan0 and bring it up.
- Start openvpn-server@myvpn .
I think the default solution (Raspbian based on Debian Jessie on my Pi 2) is mostly there; it runs ifplugd, and doesn't appear to have systemd-networkd installed or running. ifplugd exits, though, instead of running as a daemon. So I might be able to add a script in /etc/ifplugd/action.d/ that would take care of the VPN shutdown. I just need to be sure it's disabled so it doesn't start up while the Ethernet is connected.
TIA for any help!