chore: Replace if already existing

This commit is contained in:
Kyle Gospodnetich 2024-07-24 18:55:44 -07:00
parent 4ed6012b21
commit ffc7be6733

View File

@ -66,7 +66,11 @@ sed -i "s/^ID=.*/ID=${IMAGE_PRETTY_NAME,}\nID_LIKE=\"rhel centos fedora\"/" /usr
sed -i "s/^LOGO=.*/LOGO=$LOGO_ICON/" /usr/lib/os-release
sed -i "s/^ANSI_COLOR=.*/ANSI_COLOR=\"$LOGO_COLOR\"/" /usr/lib/os-release
sed -i "/^REDHAT_BUGZILLA_PRODUCT=/d; /^REDHAT_BUGZILLA_PRODUCT_VERSION=/d; /^REDHAT_SUPPORT_PRODUCT=/d; /^REDHAT_SUPPORT_PRODUCT_VERSION=/d" /usr/lib/os-release
grep -q '^VERSION_CODENAME=' /usr/lib/os-release || echo "VERSION_CODENAME=\"$CODE_NAME\"" >> /usr/lib/os-release
if [[ $(grep -q '^VERSION_CODENAME=' /usr/lib/os-release) ]]; then
echo "VERSION_CODENAME=\"$CODE_NAME\"" >> /usr/lib/os-release
else
sed -i "s/^VERSION_CODENAME=.*/VERSION_CODENAME=\"$CODE_NAME\"/" /usr/lib/os-release
fi
if [ -n "${SHA_HEAD_SHORT:-}" ]; then
echo "BUILD_ID=\"$SHA_HEAD_SHORT\"" >> /usr/lib/os-release