Fix sed command

This commit is contained in:
Laura Hausmann 2023-03-13 04:24:10 +01:00
parent 7fde07f424
commit 480631b3cc
Signed by untrusted user: zotan
GPG key ID: D044E84C5BE01605

View file

@ -321,7 +321,7 @@ basic_postinstall(){
# Fix up multiple match clauses generated by borked cloud-init
for f in /mnt/etc/systemd/network/??-cloud-init-*.network; do
# Check if [Match] section contains MACAddress
cat "$f" | grep "\[Match\]" --after-context 999 | sed -z 's/\n\n/.*/\n/g' | grep -q "MACAddress="
cat "$f" | grep "\[Match\]" --after-context 999 | sed -z 's/\n\n.*/\n/g' | grep -q "MACAddress="
if [[ $? -eq 0 ]]; then
# Remove Name= match clause
sed -z -i 's/Name=.*?\n//g' "$f"