Merge pull request #2625 from wmertens/dhcpcd-hooks
dhcpcd: Allow adding hook code
This commit is contained in:
commit
2d04728470
|
@ -57,6 +57,8 @@ let
|
||||||
#if [ "$reason" = EXPIRE -o "$reason" = RELEASE -o "$reason" = NOCARRIER ] ; then
|
#if [ "$reason" = EXPIRE -o "$reason" = RELEASE -o "$reason" = NOCARRIER ] ; then
|
||||||
# ${config.systemd.package}/bin/systemctl start ip-down.target
|
# ${config.systemd.package}/bin/systemctl start ip-down.target
|
||||||
#fi
|
#fi
|
||||||
|
|
||||||
|
${config.networking.dhcpcd.runHook}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in
|
in
|
||||||
|
@ -86,6 +88,16 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
networking.dhcpcd.runHook = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
example = "if [[ $reason =~ BOUND ]]; then echo $interface: Routers are $new_routers - were $old_routers; fi";
|
||||||
|
description = ''
|
||||||
|
Shell code that will be run after all other hooks. See
|
||||||
|
`man dhcpcd-run-hooks` for details on what is possible.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue