forked from mirrors/nixpkgs
Merge pull request #77554 from lheckemann/fix-wpa-multiple1
nixos/wpa_supplicant: fix use with multiple interfaces
This commit is contained in:
commit
8305186bb4
|
@ -233,6 +233,7 @@ in {
|
||||||
path = [ pkgs.wpa_supplicant ];
|
path = [ pkgs.wpa_supplicant ];
|
||||||
|
|
||||||
script = ''
|
script = ''
|
||||||
|
iface_args="-s -u -D${cfg.driver} -c ${configFile}"
|
||||||
${if ifaces == [] then ''
|
${if ifaces == [] then ''
|
||||||
for i in $(cd /sys/class/net && echo *); do
|
for i in $(cd /sys/class/net && echo *); do
|
||||||
DEVTYPE=
|
DEVTYPE=
|
||||||
|
@ -240,14 +241,14 @@ in {
|
||||||
if [ -e "$UEVENT_PATH" ]; then
|
if [ -e "$UEVENT_PATH" ]; then
|
||||||
source "$UEVENT_PATH"
|
source "$UEVENT_PATH"
|
||||||
if [ "$DEVTYPE" = "wlan" -o -e /sys/class/net/$i/wireless ]; then
|
if [ "$DEVTYPE" = "wlan" -o -e /sys/class/net/$i/wireless ]; then
|
||||||
ifaces="$ifaces''${ifaces:+ -N} -i$i"
|
args+="''${args:+ -N} -i$i $iface_args"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
'' else ''
|
'' else ''
|
||||||
ifaces="${concatStringsSep " -N " (map (i: "-i${i}") ifaces)}"
|
args="${concatMapStringsSep " -N " (i: "-i${i} $iface_args") ifaces}"
|
||||||
''}
|
''}
|
||||||
exec wpa_supplicant -s -u -D${cfg.driver} -c ${configFile} $ifaces
|
exec wpa_supplicant $args
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue