captive-browser: fix empty string in interface args

Fixes nmcli being passed an empty string before the interface name,
which would stop captive-browser from starting up.

(cherry picked from commit 910f233fb7120c51cb8cbbaed4fab4caa6e5d751)
This commit is contained in:
Ankit Pandey 2021-08-01 13:40:06 -05:00 committed by github-actions[bot]
parent 4e749dc0a1
commit 66e129b194
1 changed files with 6 additions and 6 deletions

View File

@ -85,18 +85,18 @@ in
programs.captive-browser.dhcp-dns =
let
iface = prefix:
optionalString cfg.bindInterface (concatStringsSep " " (map escapeShellArg [ prefix cfg.interface ]));
iface = prefixes:
optionalString cfg.bindInterface (escapeShellArgs (prefixes ++ [ cfg.interface ]));
in
mkOptionDefault (
if config.networking.networkmanager.enable then
"${pkgs.networkmanager}/bin/nmcli dev show ${iface ""} | ${pkgs.gnugrep}/bin/fgrep IP4.DNS"
"${pkgs.networkmanager}/bin/nmcli dev show ${iface []} | ${pkgs.gnugrep}/bin/fgrep IP4.DNS"
else if config.networking.dhcpcd.enable then
"${pkgs.dhcpcd}/bin/dhcpcd ${iface "-U"} | ${pkgs.gnugrep}/bin/fgrep domain_name_servers"
"${pkgs.dhcpcd}/bin/dhcpcd ${iface ["-U"]} | ${pkgs.gnugrep}/bin/fgrep domain_name_servers"
else if config.networking.useNetworkd then
"${cfg.package}/bin/systemd-networkd-dns ${iface ""}"
"${cfg.package}/bin/systemd-networkd-dns ${iface []}"
else
"${config.security.wrapperDir}/udhcpc --quit --now -f ${iface "-i"} -O dns --script ${
"${config.security.wrapperDir}/udhcpc --quit --now -f ${iface ["-i"]} -O dns --script ${
pkgs.writeShellScript "udhcp-script" ''
if [ "$1" = bound ]; then
echo "$dns"