aboutsummaryrefslogtreecommitdiffstats
path: root/www/gen-download-page.sh
blob: c1360441e8845ecb4644a39a05075675c7ef5237 (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
26
27
28
#!/bin/sh

project='mtest'
out='www/downloads.html'
remote="http://distfiles.bofc.pl/${project}"

# extract links to files
links="$(curl "${remote}/" 2>/dev/null \
    | grep "${project}-[0-9]*\.[0-9]*\.[0-9]*\." | sort -r)"

exec 1<&-
exec 1<>"${out}"

echo > "${out}"
echo "<h1>downloads</h1>"
echo "<h2>git</h2>"
echo "<p>"
echo "git clone git@git.bofc.pl:${project}<br>"
echo "git clone git://git.bofc.pl/${project}<br>"
echo "git clone http://git.bofc.pl/${project}<br>"
echo "</p>"

echo "<h2>tarballs</h2>"
echo "<pre>"

# convert links to absolute
echo "${links}" | sed "s!a href=\"!a href=\"${remote}/!"
echo "</pre>"