From e9b2ef9fb7ba4582e7a51d2022e5fc30720f8962 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 15 Nov 2009 20:40:41 +0000 Subject: [PATCH] * Restart wpa_supplicant and dhclient on resume. svn path=/nixos/branches/upstart-0.6/; revision=18360 --- modules/services/networking/dhclient.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/services/networking/dhclient.nix b/modules/services/networking/dhclient.nix index 600b7196aa4f..a714562444e0 100644 --- a/modules/services/networking/dhclient.nix +++ b/modules/services/networking/dhclient.nix @@ -103,6 +103,22 @@ in } ]; + powerManagement.resumeCommands = + '' + export PATH=${config.system.build.upstart}/sbin:$PATH + + restart() { + local job="$1" + if initctl status "$job" 2> /dev/null | grep -q 'running'; then + initctl stop "$job" + initctl start "$job" + fi + } + + restart wpa_supplicant + restart dhclient + ''; + }; }