Merge pull request #196 from Maik93/master

improve grub.bak existance check
This commit is contained in:
Vince 2023-07-11 00:25:51 +08:00 committed by GitHub
commit 4c7bba04ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -136,8 +136,16 @@ install() {
prompt -i "\n Setting ${theme} as default..."
# Backup grub config
if [[ ! -f "/etc/default/grub.bak" ]]; then
cp -an /etc/default/grub /etc/default/grub.bak
if [[ -f /etc/default/grub.bak ]]; then
echo -ne "\n${b_CWAR}File '/etc/default/grub.bak' already exists. Remove it? [yN]${CDEF}"
read choice
if [ "$choice" = 'y' ]; then
cp -a /etc/default/grub /etc/default/grub.bak
else
echo -ne "\n${b_CWAR}Skipping to save a backup configuration in '/etc/default/grub.bak'${CDEF}"
fi
else
cp -a /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