Script checking if running kernel is point-release of git source,
cat checkit
cat checkit
Code:
#!/bin/sh
URL="https://raw.githubusercontent.com/freebsd/freebsd-src/refs/heads/releng/15.1/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 -k)
# 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

