From d29c3dc710a457dda71ca155992327385fc4b0ad Mon Sep 17 00:00:00 2001 From: xdavidwu Date: Tue, 7 Dec 2021 11:47:33 +0800 Subject: [PATCH] checknupdate: use json data --- checknupdate.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/checknupdate.sh b/checknupdate.sh index eec0e1d..9d92892 100755 --- a/checknupdate.sh +++ b/checknupdate.sh @@ -7,14 +7,14 @@ CURR_PATCHLEVEL=$(echo $VER | cut -d '.' -f 2) CURR_SUBLEVEL=$(echo $VER | cut -d '.' -f 3) CURR_BRANCH=$CURR_VERSION.$CURR_PATCHLEVEL -VERSION=$(rsstail -1pNu https://www.kernel.org/feeds/kdist.xml | grep "^ $CURR_VERSION\.$CURR_PATCHLEVEL[:\.]") +VERSION=$(curl https://www.kernel.org/releases.json | jq -r '.releases[].version' | grep "^$CURR_VERSION\.$CURR_PATCHLEVEL") if [ ! -n "$VERSION" ];then echo "Error: $CURR_BRANCH may be EOLed" exit 1 fi -NEW_SUBLEVEL=$(echo "$VERSION" | tail -n 1 | cut -d ':' -f 1 | cut -d '.' -f 3) +NEW_SUBLEVEL=$(echo "$VERSION" | cut -d '.' -f 3) if [ ! -n "$NEW_SUBLEVEL" ];then exit 0 -- 2.45.2