Update install.sh

This commit is contained in:
vinceliuice 2023-04-15 22:46:16 +08:00
parent 967a302d8f
commit d0a481efa1
1 changed files with 5 additions and 2 deletions

View File

@ -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"