Files
wpa_supplicant/check-version.sh
T
2025-08-02 20:28:51 +03:00

16 lines
410 B
Bash

#!/bin/bash
# Git repository
REPO="git://w1.fi/hostap.git"
# Get tag name using 'git ls-remote'
TAG_NAME=$(git ls-remote --exit-code --refs --tags --sort='v:refname' "$REPO" | tail -1 | cut -d'/' -f3)
# Trim 'hostap_' prefix from TAG_NAME variable
VERSION=$(echo "$TAG_NAME" | sed 's/hostap_//g')
# Replace underscores with dots in VERSION variable
VERSION=$(echo "$VERSION" | tr '_' '.')
echo "$VERSION"