mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
nixos/networking-interfaces-scripted: use read -r
...instead of plain read, which can cause issues. See SC2162: https://www.shellcheck.net/wiki/SC2162
This commit is contained in:
parent
f388bc8e87
commit
2e98ec0e0e
1 changed files with 2 additions and 2 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue