summaryrefslogtreecommitdiff
path: root/manualPorts/thunderbird/lastVersion.sh
blob: da6c0d3fc63ab1d1e7c04cb5fbdb2f5a7c08e220 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash

for vers in $(
  curl 'http://ftp.mozilla.org/pub/thunderbird/releases/' 2> /dev/null | \
    tr '"' '\n' | \
    grep '^/pub/thunderbird/releases/[0-9.]\+/$' | \
    sed 's|^/pub/thunderbird/releases/\([0-9.]\+\)/$|\1|' | \
    sort -rV
); do

  ver="$(
    curl "http://ftp.mozilla.org/pub/thunderbird/releases/$vers/" 2> /dev/null | \
      tr '"' '\n' | \
      grep '^/pub/thunderbird/releases/[0-9.]\+/source/$' | \
      sed 's|^/pub/thunderbird/releases/\([0-9.]\+\)/source/$|\1|' | \
      sort -V | \
      tail -n1
  )"

  [ -z "${ver}" ] && continue

  echo "${ver}"
  exit

done