dhcpcd.nix: Add a reload action for rebinding interfaces
This commit is contained in:
parent
2ce5abaedf
commit
f903a3dcc8
|
@ -62,7 +62,7 @@ let
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#if [ "$reason" = EXPIRE -o "$reason" = RELEASE -o "$reason" = NOCARRIER ] ; then
|
#if [ "$reason" = EXPIRE -o "$reason" = RELEASE -o "$reason" = NOCARRIER ] ; then
|
||||||
# ${config.system.build.upstart}/sbin/initctl emit -n ip-down $params
|
# ${config.system.build.systemd}/bin/systemctl start ip-down.target
|
||||||
#fi
|
#fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -102,6 +102,11 @@ in
|
||||||
daemonType = "fork";
|
daemonType = "fork";
|
||||||
|
|
||||||
exec = "dhcpcd --config ${dhcpcdConf}";
|
exec = "dhcpcd --config ${dhcpcdConf}";
|
||||||
|
|
||||||
|
serviceConfig =
|
||||||
|
''
|
||||||
|
ExecReload=${dhcpcd}/sbin/dhcpcd --rebind
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [ dhcpcd ];
|
environment.systemPackages = [ dhcpcd ];
|
||||||
|
@ -115,8 +120,7 @@ in
|
||||||
powerManagement.resumeCommands =
|
powerManagement.resumeCommands =
|
||||||
''
|
''
|
||||||
# Tell dhcpcd to rebind its interfaces if it's running.
|
# Tell dhcpcd to rebind its interfaces if it's running.
|
||||||
status="$(${config.system.build.upstart}/sbin/status dhcpcd)"
|
${config.system.build.systemctl}/bin/systemctl reload dhcpcd.service
|
||||||
[[ "$status" =~ start/running ]] && ${dhcpcd}/sbin/dhcpcd --rebind
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue