Environment variable set in the dhcpcd.conf profile is not passed to dhcpcd run hooks

2

When I set variable in the profile in the /etc/dhcpcd.conf it is not passed to the hook script:

interface eth0
arping 192.168.0.1

profile A1:B2:C3:D4:E5:F6
env enable_proxy=1

However, when I put the variable before the profile, like this:

interface eth0
arping 192.168.0.1
env enable_proxy=1

profile A1:B2:C3:D4:E5:F6

it is suddenly visible inside the hook script. What is going on? The profile is executed correctly - the network configuration inside it is evaluated properly but env option has no effect. How can I set environment variables for hook scripts from dhcpcd profile?

carbolymer

Posted 2018-02-19T12:04:10.120

Reputation: 121

Look over https://www.daemon-systems.org/man/dhcpcd-run-hooks.8.html in case you need to add something there that ensures the dhcpcd.conf are effective per your usage.

– Pimp Juice IT – 2018-02-19T15:37:11.563

Answers

0

Turns out, that profiles in DHCPCD are case sensitive i.e. instead of

profile A1:B2:C3:D4:E5:F6

I should've written profile name in lower case:

profile a1:b2:c3:d4:e5:f6

Now everything works as it should.

carbolymer

Posted 2018-02-19T12:04:10.120

Reputation: 121