Skip to content

Commit

Permalink
chore: Fix configure-grub action if /etc/default/grub doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleGospo committed Dec 29, 2024
1 parent 4530bd6 commit 1c23277
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ _install-system-flatpaks:
configure-grub ACTION="":
#!/usr/bin/bash
source /usr/lib/ujust/ujust.sh
sudo touch /etc/default/grub
GRUB_STATE="$(grep -P "^GRUB_TIMEOUT_STYLE=hidden" /etc/default/grub)"
OPTION={{ ACTION }}
if [ "$GRUB_STATE" == "GRUB_TIMEOUT_STYLE=hidden" ]; then
Expand All @@ -37,6 +38,7 @@ configure-grub ACTION="":
OPTION=$(Choose "Hide Grub" "Unhide Grub" "Fix double ostree entry")
fi
if [[ "${OPTION,,}" =~ ^hide ]]; then
grep -q '^GRUB_TIMEOUT=' /etc/default/grub || echo 'GRUB_TIMEOUT=0' | sudo tee -a /etc/default/grub 1>/dev/null
sudo sed -i 's/GRUB_TIMEOUT=5/GRUB_TIMEOUT=0/g' /etc/default/grub
echo 'GRUB_TIMEOUT_STYLE=hidden' | sudo tee -a /etc/default/grub 1>/dev/null
echo 'GRUB_HIDDEN_TIMEOUT=1' | sudo tee -a /etc/default/grub 1>/dev/null
Expand Down

0 comments on commit 1c23277

Please sign in to comment.