Clean Boot Partition Script

Script that cleans the /boot directory. Run as a daily cron job, just because I didn’t feel like dealing with this issue anymore.

#/bin/bash
ls /boot/ | grep vmlinuz | sed 's@vmlinuz-@linux-image-@g' | grep -v `uname -r` > /tmp/kernelList
for I in `cat /tmp/kernelList`
do
apt remove $I -y
done
rm -f /tmp/kernelList
update-grub