PortValhalla/scripts/Common/Config/GRUB/verbose.sh

9 lines
345 B
Bash
Executable file

#!/bin/bash
configFile=/etc/default/grub;
pattern="^\\(GRUB_CMDLINE_LINUX_DEFAULT=\".*\\)\\([[:space:]]quiet\\|quiet[[:space:]]\\)\\(.*\".*\\)$";
if grep "$pattern" "$configFile" > /dev/null
then
sudo sed -i "/$pattern/{ h; s/^\\(.*\\)$/#\\1/; p; x; s/$pattern/\\1\\3/; };" "$configFile";
sudo grub-mkconfig -o /boot/grub/grub.cfg;
fi;