diff --git a/installer b/installer index 1252ed6..2268789 100755 --- a/installer +++ b/installer @@ -1676,12 +1676,9 @@ install_main() install_login # changing distro name? - if grep -q 'ArchLabs' "$MNT/etc/os-release" && [[ $DIST != 'ArchLabs' ]]; then - sed -i "s/ArchLabs/$DIST/g" "$MNT/etc/lsb-release" - sed -i "s/ArchLabs/$DIST/g" "$MNT/etc/os-release" - else - sed -i "s/Arch/$DIST/g" "$MNT/etc/lsb-release" - sed -i "s/Arch/$DIST/g" "$MNT/etc/os-release" + if [[ -f "$MNT/etc/os-release" ]] && ! grep -q "$DIST" "$MNT/etc/os-release"; then + n=$(awk '/^NAME=/ {gsub(/^NAME=|"|'\''/, ""); print $1}' "$MNT/etc/os-release" 2> /dev/null) + sed -i "s/$n/$DIST/g" "$MNT/etc/os-release" fi # allow members of the wheel group to run commands as root