diff --git a/rc/bin/gbatype b/rc/bin/gbatype new file mode 100755 index 000000000..4eefada40 --- /dev/null +++ b/rc/bin/gbatype @@ -0,0 +1,18 @@ +#!/bin/rc +file=$1 +if(~ $#file 0) + file=/fd/0 +if(! crc=`{crc32 <$file}) + exit $status +url=`{hget 'http://releases.pocketheaven.com/advsearching.php?CRC32='^$crc | sed -n 's/[^"]*"([^"]*)"[^"]*/\1\n/gp' | sed -n '/index\.php\?.*rel=[0-9]*/ { s/^/http:\/\/releases.pocketheaven.com\//; p; q;}'} +if(~ $#url 0){ + echo $file: $crc not found >[1=2] + exit 'not found' +} +hget $url | sed -n 's/.*