From dde4c077d269024199853843b8de0033f64917d3 Mon Sep 17 00:00:00 2001 From: Tomodachi94 Date: Mon, 9 Dec 2024 01:28:54 +0000 Subject: [PATCH] nixos/networking-interfaces-scripted: use read -r ...instead of plain read, which can cause issues. See SC2162: https://www.shellcheck.net/wiki/SC2162 (cherry picked from commit 2e98ec0e0eb30615a75242233b3ba1d92cd20631) --- nixos/modules/tasks/network-interfaces-scripted.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/tasks/network-interfaces-scripted.nix b/nixos/modules/tasks/network-interfaces-scripted.nix index 83c0dc27885e3..4170ce6e71ea7 100644 --- a/nixos/modules/tasks/network-interfaces-scripted.nix +++ b/nixos/modules/tasks/network-interfaces-scripted.nix @@ -237,7 +237,7 @@ let preStop = '' state="/run/nixos/network/routes/${i.name}" if [ -e "$state" ]; then - while read cidr; do + while read -r cidr; do echo -n "deleting route $cidr... " ip route del "$cidr" dev "${i.name}" >/dev/null 2>&1 && echo "done" || echo "failed" done < "$state" @@ -246,7 +246,7 @@ let state="/run/nixos/network/addresses/${i.name}" if [ -e "$state" ]; then - while read cidr; do + while read -r cidr; do echo -n "deleting address $cidr... " ip addr del "$cidr" dev "${i.name}" >/dev/null 2>&1 && echo "done" || echo "failed" done < "$state"