mirror of
https://github.com/vinceliuice/grub2-themes.git
synced 2024-11-05 13:36:14 +01:00
Update install.sh
This commit is contained in:
parent
967a302d8f
commit
d0a481efa1
@ -120,7 +120,9 @@ install() {
|
||||
prompt -s "\n Setting ${theme} as default..."
|
||||
|
||||
# Backup grub config
|
||||
cp -an /etc/default/grub /etc/default/grub.bak
|
||||
if [[ ! -f "/etc/default/grub.bak" ]]; then
|
||||
cp -an /etc/default/grub /etc/default/grub.bak
|
||||
fi
|
||||
|
||||
# Fedora workaround to fix the missing unicode.pf2 file (tested on fedora 34): https://bugzilla.redhat.com/show_bug.cgi?id=1739762
|
||||
# This occurs when we add a theme on grub2 with Fedora.
|
||||
@ -352,7 +354,7 @@ remove() {
|
||||
# Check for root access and proceed if it is present
|
||||
if [ "$UID" -eq "$ROOT_UID" ]; then
|
||||
|
||||
echo -e "\n Checking for the existence of themes directory..."
|
||||
echo -e "Checking for the existence of themes directory..."
|
||||
if [[ -d "${THEME_DIR}/${theme}" ]]; then
|
||||
rm -rf "${THEME_DIR}/${theme}"
|
||||
else
|
||||
@ -381,6 +383,7 @@ remove() {
|
||||
|
||||
# Backup with --in-place option to grub.bak within the same directory; then remove the current theme.
|
||||
sed --in-place='.bak' "s|$current_theme|#GRUB_THEME=|" "$grub_config_location"
|
||||
rm -rf "$grub_config_location".bak
|
||||
|
||||
# Update grub config
|
||||
prompt -s "\n Resetting grub theme...\n"
|
||||
|
Loading…
Reference in New Issue
Block a user