Files
wpa_supplicant/check-version.sh
T

16 lines
416 B
Bash

#!/bin/bash
# Git repository
REPO="https://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"