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
  • 174,089
  • 51
  • 332
  • 407
Adrian George
  • 3,671
  • 8
  • 24
  • 30

2 Answers2

0

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

Radu Rădeanu
  • 174,089
  • 51
  • 332
  • 407
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.