#!/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