talimatname-indeksleme

This commit is contained in:
milisbir 2018-10-17 00:19:10 +03:00
parent f90832b900
commit 193590ce4d
1 changed files with 10 additions and 6 deletions

View File

@ -1,11 +1,9 @@
#!/bin/sh
if [ -z $1 ];then
echo "kullanım: $0 > index.html"
exit 1
fi
# Bu betik talimatnamede yer alan talimatları web sayfası sunumu için indeksler.
# Kullanım: talimatname_indeks.sh > index.html
paketdepo="http://paketler.milislinux.org"
#paketdepo="http://127.0.0.1:8000"
dosya=/tmp/paket_konumlar
[ -f $dosya ] && rm -rf $dosya
find /root/talimatname/temel/* -type d > $dosya
@ -24,6 +22,7 @@ echo '<th scope="col">Sürüm</th>'
echo '<th scope="col">Açıklama</th>'
echo '<th scope="col">Url</th>'
echo '<th scope="col">Paket Adresi</th>'
echo '<th scope="col">Son Güncelleme</th>'
echo '</tr>'
echo '</thead>'
@ -55,9 +54,14 @@ while IFS='' read -r konum || [[ -n "$konum" ]]; do
echo "<td><a href=$url>$url</a></td>"
# İndir
echo "<td><a href=${paketdepo}/${isim}%23${surum}-x86_64.mps.lz>indir</a></td>"
purl="${paketdepo}/${isim}%23${surum}-x86_64.mps.lz"
echo "<td><a href=${purl}>indir</a></td>"
# %23 = #
# Güncelleme Tarih
gtarih=$(curl -s -v -X HEAD $purl 2>&1 | grep '^< Last-Modified:' | cut -d':' -f2-)
echo "<td>$gtarih</td>"
echo "</tr>"
done < "$dosya"