Make centos reset-bls-entries behave the same as rhel

This makes 03-reset-bls-entries consistent with rhel so that the glob
match is *.conf, and a check is added to ensure that a rename is
actually required.

Change-Id: I4adff43cf7d4f31d939e6ddf37ac8d162ccd0db7
This commit is contained in:
Steve Baker 2022-04-29 10:54:52 +12:00
parent 555cecb670
commit 8059a59583

View File

@ -21,10 +21,12 @@ pushd /boot/loader/entries
machine_id=$(</etc/machine-id) machine_id=$(</etc/machine-id)
for entry in *; do for entry in *.conf; do
new_entry=$(echo $entry | sed "s/^[a-f0-9]*/$machine_id/") new_entry=$(echo $entry | sed "s/^[a-f0-9]*/$machine_id/")
echo "renaming $entry to $new_entry for new machine-id" echo "renaming $entry to $new_entry for new machine-id"
mv $entry $new_entry if [[ $entry != $new_entry ]]; then
mv $entry $new_entry
fi
done done
popd popd