Cleaned up both scripts
This commit is contained in:
parent
64ad4e635e
commit
e44f63ae09
@ -6,10 +6,12 @@ set -l snapshot_ids (snapper -c $config --jsonout ls | jq ".$config | .[] | .num
|
||||
|
||||
|
||||
# get current ukis
|
||||
set -l ukis (ls /boot/EFI/Linux/ | grep "snap-pac-uki-[1-9][0-9]*\.efi" | grep -o '[1-9][0-9]*')
|
||||
set -l ukis (ls /boot/EFI/Linux/ | grep '^snap-pac-uki-[1-9][0-9]*\.efi$' | grep -o "[1-9][0-9]*")
|
||||
|
||||
for x in $ukis
|
||||
if not contains $x $snapshot_ids
|
||||
rm "/boot/EFI/Linux/snap-pac-uki-$x.efi"
|
||||
set -l path "/boot/EFI/Linux/snap-pac-uki-$x.efi"
|
||||
rm $path
|
||||
echo "==> removed UKI: $path"
|
||||
end
|
||||
end
|
||||
|
@ -12,7 +12,7 @@ end
|
||||
|
||||
|
||||
# check if UKI already exists
|
||||
set -l ukis (ls /boot/EFI/Linux/ | grep "snap-pac-uki-[1-9][0-9]*\.efi" | grep -o '[1-9][0-9]*')
|
||||
set -l ukis (ls /boot/EFI/Linux/ | grep '^snap-pac-uki-[1-9][0-9]*\.efi$' | grep -o "[1-9][0-9]*")
|
||||
|
||||
if contains $id $ukis
|
||||
echo "==> UKI already exists; no UKI creation"
|
||||
|
Loading…
Reference in New Issue
Block a user