#!/bin/bash server=http://dl.contextgarden.net/build/luatex/ archs=" amd64-freebsd armhf-linux i386-darwin i386-freebsd i386-linux i386-solaris sparc-solaris x86_64-darwinlegacy x86_64-linux x86_64-solaris " check_and_move() { f=$1 a=$2 if [ ! -r $f.$a ] ; then echo "Cannot find $f.$a" fi sz=$(stat -c %s $f.$a) if [ $sz -lt 1000000 ] ; then echo "file size suspicious for $f.$a: $sz" else mkdir -p bin/$a mv $f.$a bin/$a/$f fi } for a in $archs ; do wget -O luahbtex.$a $server$a/luahbtex check_and_move luahbtex $a wget -O luajithbtex.$a $server$a/luajithbtex check_and_move luajithbtex $a done