Skip to content

Commit

Permalink
Add new entry if entry is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
agners committed Nov 7, 2023
1 parent 43a27f8 commit 34a5f67
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ elif [ -e /usr/bin/grub-editenv ]; then
else
if ! grep -q "systemd.machine_id=${MACHINE_ID}" /mnt/boot/cmdline.txt; then
echo "[INFO] set machine-id to ${MACHINE_ID}"
sed -i "s/systemd.machine_id=[0-f]*/systemd.machine_id=${MACHINE_ID}/" /mnt/boot/cmdline.txt
if sed -i "s/systemd.machine_id=[0-f]*/systemd.machine_id=${MACHINE_ID}/" /mnt/boot/cmdline.txt; then
echo "systemd.machine_id=${MACHINE_ID}" > /mnt/boot/cmdline.txt
fi
else
echo "[INFO] machine-id is okay"
fi
Expand Down

0 comments on commit 34a5f67

Please sign in to comment.