From 169527214f0214aa75818d0f9894713f0b9bc51a Mon Sep 17 00:00:00 2001 From: Teddysun Date: Wed, 22 Feb 2017 09:07:33 +0900 Subject: [PATCH] update get latest version --- bbr.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bbr.sh b/bbr.sh index 41d0b9b..f31c253 100644 --- a/bbr.sh +++ b/bbr.sh @@ -4,7 +4,7 @@ # # System Required: CentOS 6+, Debian7+, Ubuntu12+ # -# Copyright (C) 2016 Teddysun +# Copyright (C) 2016-2017 Teddysun # # URL: https://teddysun.com/489.html # @@ -36,7 +36,7 @@ fi get_latest_version() { - latest_version=$(wget -qO- http://kernel.ubuntu.com/~kernel-ppa/mainline/ | awk -F'\"v' '/v[4-9].[0-9].[0-9]/{print $2}' | cut -d/ -f1 | sort -V | tail -1) + latest_version=$(wget -qO- http://kernel.ubuntu.com/~kernel-ppa/mainline/ | awk -F'\"v' '/v[4-9]./{print $2}' | cut -d/ -f1 | grep -v - | sort -V | tail -1) if [[ `getconf WORD_BIT` == "32" && `getconf LONG_BIT` == "64" ]]; then deb_name=$(wget -qO- http://kernel.ubuntu.com/~kernel-ppa/mainline/v${latest_version}/ | grep "linux-image" | grep "generic" | awk -F'\">' '/amd64.deb/{print $2}' | cut -d'<' -f1 | head -1)