mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-10-28 17:32:35 +00:00
check_large_files.bash: cleans up dangling etc/grub.d/50_candela_X files; rebuilds grub menu
Signed-off-by: Jed Reynolds <jed@bitratchet.com>
This commit is contained in:
@@ -339,6 +339,21 @@ clean_old_kernels() {
|
||||
echo "/lib/modules/$f"
|
||||
done | xargs rm -rf
|
||||
fi
|
||||
# check to see if there are 50_candela-x files that
|
||||
# lack a /lib/modules directory
|
||||
local fifty_files=(`ls /etc/grub.d/50_candela_*`)
|
||||
local k_v
|
||||
for file in "${fifty_files[@]}"; do
|
||||
k_v=${file#/etc/grub.d/50_candela_}
|
||||
#echo "K_V[$k_v]"
|
||||
if [ ! -d /lib/modules/$k_v ]; then
|
||||
echo "/lib/modules/$k_v not found, removing /etc/grub.d/50_candela_$k_v"
|
||||
rm -f "/etc/grub.d/50_candela_${k_v}"
|
||||
fi
|
||||
done
|
||||
|
||||
grub2-mkconfig -o /boot/grub2/grub.cfg
|
||||
|
||||
if [ -d "/boot2" ]; then
|
||||
rm -rf /boot2/*
|
||||
rsync -a /boot/. /boot2/
|
||||
|
||||
Reference in New Issue
Block a user