~xdavidwu/linux-xdavidwu-xps

d29c3dc710a457dda71ca155992327385fc4b0ad — xdavidwu 3 years ago 0428219
checknupdate: use json data
1 files changed, 2 insertions(+), 2 deletions(-)

M checknupdate.sh
M checknupdate.sh => checknupdate.sh +2 -2
@@ 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