3

How can I display a message like:

eth1 interface has been enabled

each time when eth1 is enabled?

Let me know if my question make sense.

Radu Rădeanu
  • 169,590
Adrian George
  • 3,531
  • 7
  • 23
  • 30

2 Answers2

0

After some searches, I found a way how you can do it:

Radu Rădeanu
  • 169,590
0

You can add a shell script into /etc/NetworkManager/dispatcher.d that you might name 99-notification. Be sure to mark it executable with chmod +x 99-notification.

In that script, you will need to do something with the input to script, the interface name and the action.

#/bin/bash

if [[ "$1" = eth1 ]] && [[ "$2" = up ]]
then
    DISPLAY=:0.0 kdialog --passivepopup "eth1 is enabled" 3
fi

I have not tested this, but I think it will work, at least with KDE. For Unity/Gnome, you might have to exchange kdialog with zenity.