D8 curl detecting version (+ simple D7)

curl -s domain.com/core/install.php | grep site-version | grep -oE "[0-9]+\.[0-9]+\.[0-9]+"

result is exact version, but must be also correct protocol - http or https

D7:

curl -s https://domain.com/CHANGELOG.txt |head -n5 |grep -oE "[0-9]+\.[0-9]+"