* Drop ugly reference to var/run/current-system/sw/sbin/wpa_cli, and
make it conditional. svn path=/nixos/trunk/; revision=33717
This commit is contained in:
parent
83679c99b1
commit
a7af5588b6
@ -45,7 +45,9 @@ let
|
|||||||
|
|
||||||
# only works when interface is wireless and wpa_supplicant has a control socket
|
# only works when interface is wireless and wpa_supplicant has a control socket
|
||||||
# but we allow it to fail silently
|
# but we allow it to fail silently
|
||||||
wifiparams=$(/var/run/current-system/sw/sbin/wpa_cli -i$interface status 2>/dev/null | grep ssid | sed 's|^b|B|;s|ssid|SSID|' | xargs)
|
${optionalString config.networking.wireless.enable ''
|
||||||
|
params+=" $(${pkgs.wpa_supplicant}/sbin/wpa_cli -i$interface status 2>/dev/null | grep ssid | sed 's|^b|B|;s|ssid|SSID|' | xargs)"
|
||||||
|
''}
|
||||||
|
|
||||||
if [ "$reason" = BOUND -o "$reason" = REBOOT ]; then
|
if [ "$reason" = BOUND -o "$reason" = REBOOT ]; then
|
||||||
# Restart ntpd. (The "ip-up" event below will trigger the
|
# Restart ntpd. (The "ip-up" event below will trigger the
|
||||||
@ -56,11 +58,11 @@ let
|
|||||||
# it"), so we silently lose time synchronisation.
|
# it"), so we silently lose time synchronisation.
|
||||||
${config.system.build.upstart}/sbin/initctl stop ntpd
|
${config.system.build.upstart}/sbin/initctl stop ntpd
|
||||||
|
|
||||||
${config.system.build.upstart}/sbin/initctl emit -n ip-up $params $wifiparams
|
${config.system.build.upstart}/sbin/initctl emit -n ip-up $params
|
||||||
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 $wifiparams
|
${config.system.build.upstart}/sbin/initctl emit -n ip-down $params
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -126,7 +126,6 @@ in
|
|||||||
assertions = [{ assertion = !cfg.userControlled.enable || cfg.interfaces != [];
|
assertions = [{ assertion = !cfg.userControlled.enable || cfg.interfaces != [];
|
||||||
message = "user controlled wpa_supplicant needs explicit networking.wireless.interfaces";}];
|
message = "user controlled wpa_supplicant needs explicit networking.wireless.interfaces";}];
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user