I have a switch on my PI and I want to be able to use a static ip or dynamic ip based on the switches position.
Is it possible to get GPIO pin data in dhcpcd.conf?
I have a switch on my PI and I want to be able to use a static ip or dynamic ip based on the switches position.
Is it possible to get GPIO pin data in dhcpcd.conf?
The Answer to the Question you actually asked is quite simple.
dhcpcd
is a generic service which is applicable to ANY Linux distribution.
It is NOT specific to the Pi, has no knowledge of the Pi hardware, and thus has NO code which could interrogate the Pi hardware.
It would be possible to write some code to re-configure dhcpcd
when a GPIO pin changes state, but you will have to write this yourself.