aboutsummaryrefslogtreecommitdiffstats
path: root/gen-download-page.sh
blob: b65e74e59bbaa20de393c74ff8898bcc7e900ded (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.kurwinet.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@kurwinet.pl:${project}<br>"
echo "git clone git://kurwinet.pl/${project}<br>"
echo "git clone http://git.kurwinet.pl/${project}<br>"
echo "</p>"

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

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