Skip to content

Commit

Permalink
nixos/networking: fix shellcheck findings with enableStrictShellCheck…
Browse files Browse the repository at this point in the history
…s enabled (#349573)
  • Loading branch information
Scrumplex authored Jan 13, 2025
2 parents 4f3f5ec + 8e6cc2f commit f571531
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nixos/modules/tasks/network-interfaces-scripted.nix
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ let
script =
''
state="/run/nixos/network/addresses/${i.name}"
mkdir -p $(dirname "$state")
mkdir -p "$(dirname "$state")"
ip link set dev "${i.name}" up
Expand All @@ -206,14 +206,14 @@ let
if out=$(ip addr replace "${cidr}" dev "${i.name}" 2>&1); then
echo "done"
else
echo "'ip addr replace "${cidr}" dev "${i.name}"' failed: $out"
echo "'ip addr replace \"${cidr}\" dev \"${i.name}\"' failed: $out"
exit 1
fi
''
)}
state="/run/nixos/network/routes/${i.name}"
mkdir -p $(dirname "$state")
mkdir -p "$(dirname "$state")"
${flip concatMapStrings (i.ipv4.routes ++ i.ipv6.routes) (route:
let
Expand All @@ -228,7 +228,7 @@ let
if out=$(ip route add ${type} "${cidr}" ${options} ${via} dev "${i.name}" proto static 2>&1); then
echo "done"
elif ! echo "$out" | grep "File exists" >/dev/null 2>&1; then
echo "'ip route add ${type} "${cidr}" ${options} ${via} dev "${i.name}"' failed: $out"
echo "'ip route add ${type} \"${cidr}\" ${options} ${via} dev \"${i.name}\"' failed: $out"
exit 1
fi
''
Expand Down

0 comments on commit f571531

Please sign in to comment.