From 13b65354f9ce022ea13366282cc94cd05614e3ab Mon Sep 17 00:00:00 2001 From: natemaia Date: Wed, 4 Nov 2020 16:44:20 -0800 Subject: [PATCH] Fix: issue with os-release name being doubled --- installer | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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