Run script after interface up when using NetworkManager

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

References

Network Manager script when interface up?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


The reCAPTCHA verification period has expired. Please reload the page.