* usr/bin/purge-old-kernels:

- ensure that we keep the current running kernel
This commit is contained in:
Dustin Kirkland 2016-11-28 11:26:30 -06:00
commit 3649eec285
2 changed files with 5 additions and 2 deletions

2
debian/changelog vendored
View file

@ -8,6 +8,8 @@ byobu (5.113) unreleased; urgency=medium
- when selecting a session, if only empty sessions exist, then create - when selecting a session, if only empty sessions exist, then create
a new one; the bug was that tmux considers a null string argument a new one; the bug was that tmux considers a null string argument
still an argument still an argument
* usr/bin/purge-old-kernels:
- ensure that we keep the current running kernel
-- Dustin Kirkland <kirkland@ubuntu.com> Fri, 16 Sep 2016 10:13:08 -0500 -- Dustin Kirkland <kirkland@ubuntu.com> Fri, 16 Sep 2016 10:13:08 -0500

View file

@ -44,8 +44,9 @@ while [ ! -z "$1" ]; do
esac esac
done done
# Build our list of kernel packages to purge # Build our list of kernel packages to purge, make sure we exclude the current running kernel
VERSIONS=$(ls -f /boot/vmlinuz-* | sed -e "s/[^\-]*-//" -e "s/-[^\-]*$//" | sort -rh) current="$(uname -r)"
VERSIONS=$(ls -f /boot/vmlinuz-* | grep -v "$current$" | sed -e "s/[^\-]*-//" -e "s/-[^\-]*$//" | sort -rh)
count=0 count=0
for v in $VERSIONS; do for v in $VERSIONS; do
count=$((count+1)) count=$((count+1))