From a32502f6ed50fa4a106358f6e1bde8d73d4f959c Mon Sep 17 00:00:00 2001 From: Stuart Hayhurst Date: Sun, 18 Oct 2020 16:33:19 +0100 Subject: [PATCH] More robust detection of GRUB_TERMINAL=console, autocomment GRUB_TERMINAL_OUTPUT=console --- install.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 03eed25..b2bae0e 100755 --- a/install.sh +++ b/install.sh @@ -189,9 +189,14 @@ install() { echo "${gfxmode}" >> /etc/default/grub fi - if grep "GRUB_TERMINAL=console" /etc/default/grub 2>&1 >/dev/null; then + if grep "GRUB_TERMINAL=console" /etc/default/grub 2>&1 >/dev/null || grep "GRUB_TERMINAL=\"console\"" /etc/default/grub 2>&1 >/dev/null; then #Replace GRUB_TERMINAL - sed -i "s|.*GRUB_TERMINAL=console.*|#GRUB_TERMINAL=console|" /etc/default/grub + sed -i "s|.*GRUB_TERMINAL=.*|#GRUB_TERMINAL=console|" /etc/default/grub + fi + + if grep "GRUB_TERMINAL_OUTPUT=console" /etc/default/grub 2>&1 >/dev/null || grep "GRUB_TERMINAL_OUTPUT=\"console\"" /etc/default/grub 2>&1 >/dev/null; then + #Replace GRUB_TERMINAL_OUTPUT + sed -i "s|.*GRUB_TERMINAL_OUTPUT=.*|#GRUB_TERMINAL_OUTPUT=console|" /etc/default/grub fi # Update grub config