#!/bin/sh project='termsend' out='www/downloads.html' remote="https://distfiles.bofc.pl/${project}" gpg="https://distfiles.bofc.pl/bofc-signing.pub.gpg" asc="https://distfiles.bofc.pl/bofc-signing.pub.asc" get_files_from_remote() { remote="${1}" curl "${remote}/" -A "${project}-generator" 2>/dev/null | grep "a href=" | \ grep -v 'a href=".."' | cut -f2 -d\" | cut -f1 -d/ } exec 6>&1 exec 1<>"${out}" echo > "${out}" echo "

downloads

" echo "

" echo "Below you can find source files and binary packages for various systems." echo "(s) right of package name is a gpg signature. You can download" echo "gpg file or" echo "armored asc file to verify files. You can also" echo "look for key on public keyservers, fingerprint is

" echo "    63D0 C3DB 42AF 3B4F CF6E 7880 E84A 7E61 C785 0C62

" echo "You can download key directly from keyserver with

" echo "    gpg --recv-keys 63D0C3DB42AF3B4FCF6E7880E84A7E61C7850C62

" echo "Then you can verify downloaded image with command

" echo "    gpg --verify <sig-file> <package-file>" echo "

" echo "All files (including md5, sha256 and sha512 for all files) can also" echo "be downloaded from: ${remote}
" echo "

" echo "

git

" echo "

" echo "git clone git@git.bofc.pl:${project}
" echo "git clone git://git.bofc.pl/${project}
" echo "git clone http://git.bofc.pl/${project}
" echo "

" echo "

repositories

" echo "

You can also add bofc.pl repository to your system and let" echo "package manager to deal with install and updates. Depending on your" echo "distributions there are couple of repositories - neccessary instructions" echo "on how to add repository is on theirs respective sites

" echo "" echo "

notes

" echo "

Project has been renamed from kurload" echo "to termsend with v1.1.1. Downloading version v1.1.0" echo "or earlier will result in downloading package with old name, where" echo "all configs and init scripts are called kurload." echo "Thus it's inadvisible to download and use version v1.1.0 or older and" echo "they are here just for historical reasons.

" echo "

tarballs (source code)

" echo "
"

files="$(get_files_from_remote "${remote}/" | \
    grep "${project}-[0-9]*\.[0-9]*\.[0-9][\.-]\(r[0-9]\)\?")"
versions="$(echo "${files}" | tr ' ' '\n' | rev | \
    cut -f1 -d- | rev | cut -f1-3 -d. | sort -Vur)"

for v in ${versions}
do
    printf "%-10s%s(%s|%s)  %s(%s|%s)  %s(%s|%s)\n" "${v}" \
        "tar.gz" \
        "s" \
        "sha1" \
        "tar.bz2" \
        "s" \
        "sha1" \
        "tar.xz" \
        "s" \
        "sha1"
done

echo "
" distros="$(get_files_from_remote "${remote}/" | \ grep -v "${project}-[0-9]*\.[0-9]*\.[0-9][\.-]\(r[0-9]\)\?" | \ grep -v "${project}-9999.tar." | \ sort -t'-' -k1,1 -k2,2Vr)" for d in ${distros} do dname="$(echo ${d} | cut -f1 -d-)" dvers="$(echo ${d} | cut -f2 -d-)" archs="$(get_files_from_remote "${remote}/${d}/")" echo "

${dname} ${dvers}

" for a in ${archs} do files="$(get_files_from_remote "${remote}/${d}/${a}" | \ grep "${project}-[0-9]*\.[0-9]*\.[0-9][\.-]\(r[0-9]\)\?")" versions="$(echo "${files}" | tr ' ' '\n' | rev | \ cut -f1 -d- | rev | cut -f1-3 -d. | sort -Vur)" files="$(get_files_from_remote "${remote}/${d}/${a}/")" echo "

${a}

" case "${dname}" in debian|ubuntu) versions="$(echo ${files} | tr ' ' '\n' | \ cut -f2 -d_ | cut -f1-3 -d. | sort -Vur)" ;; centos|rhel|opensuse|fedora) versions="$(echo ${files} | tr ' ' '\n' | rev | \ cut -f2 -d- | rev | cut -f1-3 -d. | sort -Vur)" ;; slackware) versions="$(echo ${files} | tr ' ' '\n' | rev | \ cut -f3 -d- | rev | cut -f1-3 -d. | sort -Vur)" ;; esac echo "
"
        for v in ${versions}
        do
            case "${dname}" in

            debian)
                ABI="$(echo "${v}" | cut -f1 -d.)"
                printf "%-10s%s(%s|%s)  %s(%s)  %s(%s)\n" "${v}" \
                    "deb" \
                    "s" \
                    "sha1" \
                    "dsc" \
                    "s" \
                    "buildinfo" \
                    "s"
                ;;

            ubuntu)
                ABI="$(echo "${v}" | cut -f1 -d.)"
                printf "%-10s%s(%s|%s)  %s(%s)  %s(%s)\n" "${v}" \
                    "deb" \
                    "s" \
                    "sha1" \
                    "dsc" \
                    "s" \
                    "buildinfo" \
                    "s"
                ;;

            rhel|centos|opensuse|fedora)
                printf "%-10s%s(%s|%s)  %s(%s)\n" "${v}" \
                    "rpm" \
                    "s" \
                    "sha1" \
                    "dbginfo" \
                    "s" \
                ;;

            slackware)
                printf "%-10s%s(%s|%s)\n" "${v}" \
                    "tgz" \
                    "s" \
                    "sha1"
                ;;
            esac
        done
        echo "
" done done exec 1>&6 6>&- failed=0 for l in $(lynx -listonly -nonumbers -dump "${out}" | grep "https://distfiles") do echo -n "checking ${l}... " curl -sSfl -A "${project}-generator" "${l}" >/dev/null if [ ${?} -eq 0 ] then echo "ok" continue fi failed=1 done exit ${failed}