sannantonio
Posts: 4
Joined: Sun Apr 05, 2015 8:02 pm

Running a script after an IP addrees is assigned to eth0

Tue Dec 08, 2015 1:04 am

Good evening,
as stated in the subect, i'm trying to run a script after an IP adress is assigned to my eth0 by a dhcp server. I've a raspberry set on a read-only environment as shown in https://k3a.me/how-to-make-raspberrypi- ... uble-free/
I've tried to put a bash script in /etc/dhcp/dhclient-enter-hooks.d/ but nothing's happened.

Has anybody done something similar and wants to give me a hint?

Thank you,
as

sprinkmeier
Posts: 410
Joined: Mon Feb 04, 2013 10:48 am
Contact: Website

Re: Running a script after an IP addrees is assigned to eth0

Tue Dec 08, 2015 9:45 am

Code: Select all

/etc/network/if-up.d
You just wanted a hint, right?

sannantonio
Posts: 4
Joined: Sun Apr 05, 2015 8:02 pm

Re: Running a script after an IP addrees is assigned to eth0

Tue Dec 08, 2015 2:14 pm

Thank you,
actually, I had already tried to put my script inside if-up.d, but it executed BEFORE the IP assignment. The right answer would be to put the script in the /etc/dhcp/dhclient-enter-hooks.d/, but for some reason, scripts in that directory are not triggered. Eventually, I've put my script in /lib/dhcpcd/dhcpcd-hooks/. Now it works, even if I suppose there's a better solution.

Thank you,
as

Return to “Beginners”