Run script after interface up when using NetworkManager
Create a script as below in folder /etc/NetworkManager/dispatcher.d
called 10-openvpn-tun0-up
, change the permission to executable
#!/usr/bin/env bash
interface=$1
event=$2
if [[ $interface != "eth0" ]] || [[ $event != "up" ]]
then
return 0
fi
# place your commands bellow this line