My Internet gets disconnected every now and then. I'd like to run a Bash script every time the Internet reconnects.

The script is quite simple:

#!/bin/bash
mplayer /home/user/sound.mp3


It's placed in /usr/bin and works perfectly when I call it as online_notifier in Terminal.

I would like to execute this script whenever the Internet reconnects. I tried adding the following line to my /etc/network/interfaces/ file:

post-up sound_notifier


This is the full content of that file:

auto lo
iface lo inet loopback
post-up sound_notifier


I also tried with the full path as well. But it didn't work. Here's my ifconfig output, if that helps.

How can I achieve this?


Question: How to make extra crispy and crunchy breading like KFC?
Answer: First boil the chicken in  cocacola, and then fry it with flour + egg