the final "/main_dir" looks like a typo. also, the first cp would fail
as $proxy_script already includes the full path. One problem I see is
that, for me at least, the files in the proxifiedScripts folders have
been stripped of their numbers ("10_linux" is called "linux" for
instance). so before copying the file back, you would need to take the
script name and strip the _proxy part to find the original name:

#!/bin/bash
main_dir=/etc/grub.d 
orig_dir=$main_dir/proxifiedScripts
backup_dir=$main_dir/proxyscript_backup

mkdir -p $backup_dir
for script in $(ls $orig_dir); do
    # we're assuming there's only one proxy script for each proxied file
    proxy_script=$(ls ${main_dir}/*_"${script}"_proxy)
    new_script=$(echo "$proxy_script" | sed 's/_proxy//g')
    # back up the "proxy script"
    mv "$proxy_script" $backup_dir
    # overwrite it with the original shell script if it doesn't already exist
    if [ ! -f "$new_script" ]; then    
       cp $orig_dir/"$script" "$new_script"
    else
        echo "file already exists" 
    fi
done

Also, if 10_linux has been copied during the upgrade, chances are that
the files in the proxy folder is an older version so I wouldn't really
want the new files to be overwritten with the old ones so, a simple sudo
rm /etc/grub.d/*_proxy works just as well for me to prevent the grub
failure which I experienced post upgrade. People can always fire up
grub-customizer again and regenerate the files if needed.

Alternatively, could it be as simple as copying
/etc/grub.d/bin/grubcfg_proxy as part of the package install/update?

** Attachment added: "test.sh"
   
https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1969353/+attachment/5582507/+files/test.sh

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1969353

Title:
  Apt/Grub issue with 22.04 Upgrade (Missing libcrypto.so.1.1)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/grub-customizer/+bug/1969353/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to