Raspberry Pi – Running script on network interface Up with Raspbian 9

on

I use a Raspberry connected to a big screen on the wall as a dashboard. It’s IP address change from time to time and I wanna be notified on Slack about the new IP. So every time its wifi gets a new IP, dhcpcd triggers a hook that post to a Slack channel where I installed a WebHook App.

The script location is /lib/dhcpcd/dhcpcd-hooks/notify_ip_to_slack.sh and it looks like this:

Notice that it only runs for events “up” on the interface “wlan0”.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s