1 2 3 4 5 6 7 8
#!/bin/bash if [ $(file /boot/* | grep -i linux.kernel | wc -l) -gt 2 ] ; then echo "Cleaning old kernels..." eclean-kernel -n2 grub-mkconfig -o /boot/grub/grub.cfg fi