fyi,
root@myfreebsd:~/Scripts # cat _good_point_release
root@myfreebsd:~/Scripts # ./_good_point_release
Local Kernel: 15.1-RELEASE-p4
GitHub Version: FreeBSD 15.1-RELEASE-p6
Status: NEWER AVAILABLE
root@myfreebsd:~/Scripts #
root@myfreebsd:~/Scripts # cat _good_point_release
Code:
#!/bin/sh
#URL="https://raw.githubusercontent.com/freebsd/freebsd-src/refs/heads/releng/15.1/sys/conf/newvers.sh"
CURRENT_VER=$(uname -r | cut -d- -f1)
URL="https://raw.githubusercontent.com/freebsd/freebsd-src/refs/heads/releng/$CURRENT_VER/sys/conf/newvers.sh"
# 1. Fetch data from GitHub and evaluate assignments safely
REMOTE_DATA=$(wget -qO- "$URL")
eval "$(echo "$REMOTE_DATA" | grep -E '^(TYPE|REVISION|BRANCH)=')"
# 2. Get local version
LOCAL_VER=$(freebsd-version -u)
# 3. Format remote version exactly like local
REMOTE_VER="${REVISION}-${BRANCH}"
# 4. Print outputs
echo "Local Kernel: $LOCAL_VER"
echo "GitHub Version: $TYPE $REMOTE_VER"
# 5. Pure shell string manipulation (Zero seds)
# Extracts everything after the last "-p"
LOCAL_PATCH="${LOCAL_VER##*-p}"
REMOTE_PATCH="${REMOTE_VER##*-p}"
# If no "-p" existed, the variable won't change; reset to 0
[ "$LOCAL_PATCH" = "$LOCAL_VER" ] && LOCAL_PATCH=0
[ "$REMOTE_PATCH" = "$REMOTE_VER" ] && REMOTE_PATCH=0
# 6. Final comparison
if [ "$REMOTE_PATCH" -gt "$LOCAL_PATCH" ]; then
echo "Status: NEWER AVAILABLE"
else
echo "Status: Up to date"
fi
root@myfreebsd:~/Scripts # ./_good_point_release
Local Kernel: 15.1-RELEASE-p4
GitHub Version: FreeBSD 15.1-RELEASE-p6
Status: NEWER AVAILABLE
root@myfreebsd:~/Scripts #