instanceinfo.sh: Updated implementation detection.

Mastodon release candidates are no longer detected as fork.
This commit is contained in:
tastytea 2019-09-30 02:02:23 +02:00
parent 9a7b53fc23
commit 8297b2c21f
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
1 changed files with 4 additions and 3 deletions

View File

@ -109,11 +109,12 @@ function parse_mastodon()
if grep -Eq '"is_(pro|verified)"' <<<"${json}"; then
implementation="Gab"
elif grep -Eq '"version":"[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\."' <<<"${json}"; then
elif grep -Pq '"version":"\d+\.\d+\.\d+\.\d+\."' <<<"${json}"; then
implementation="Florence"
elif grep -Eq '"version":"[0-9]+\.[0-9]+\.[0-9]+"' <<<"${json}"; then
elif grep -Pq '"version":"\d+\.\d+\.\d+(rc\d+)?"' <<<"${json}"; then
implementation="Mastodon"
elif grep -Eq '"version":"[0-9]+\.[0-9]+\.[0-9]+[\._\-\+]?[a-zA-Z0-9\_\+\-]+"' <<<"${json}"; then
elif grep -Pq '"version":"\d+\.\d+\.\d+[\._\-\+]?[\w\_\+\-]+"' <<<"${json}"
then
implementation="Mastodon fork"
fi
if [[ -n "${implementation}" ]]; then