dhcpcd-discuss

Re: dhcpcd runhooks- which shell?

Roy Marples

Tue Aug 30 09:06:04 2016

Hi Roger

On 28/08/2016 19:55, Roger Shepherd wrote:
> I running dhcpcd 6.71. on a Raspberry Pi under Rasbian Jessie.
> 
> It seems that the runhooks run under sh rather than bash. Is this how
> it has to be, or is there an easy way of causing them to run under
> bash?

dhcpcd uses sh because every OS ships with one which should adhere to a
strict set of rules called POSIX.

Is there a reason why you need bash rather than sh? There is nothing
that can be done in bash that cannot (albeit with some creative
thinking) be done in sh.

If you really need bash simply change the first like of
/libexec/dhcpcd-run-hooks (or where-ever your OS installed it to to
#!/bin/bash).

Another alternative is to write your script in bash and call it via
dhcpcd.exit-hook or dhcpcd.enter-hook, both of which are decribed in
dhcpcd-run-hooks(8).

Roy

Follow-Ups:
Re: dhcpcd runhooks- which shell?Roger Shepherd
References:
dhcpcd runhooks- which shell?Roger Shepherd
Archive administrator: postmaster@marples.name