1234567891011121314151617181920212223242526272829303132333435363738 |
- #!/bin/bash
- set -e
- checkit() {
- #checkit <sha256sum> <filename>
- echo "$1 $2" | sha256sum -c
- }
- if [ "$#" == 0 ]
- then
- foss=(*/)
- else
- foss=($@)
- fi
- for i in "${foss[@]}"
- do
- cd "$i"
- if [ -x download ]; then
- ./download
- else
- source ./info
- fn="$(basename "$url")"
- if ! test -f "$fn"; then
- rm -f *.exe *.msi
- fi
- if ! checkit "$sha256sum" "$fn"; then
- wget -c "$url"
- if ! checkit "$sha256sum" "$fn"; then
- rm -f "$fn"
- wget "$url"
- checkit "$sha256sum" "$fn"
- fi
- fi
- fi
- cd ..
- done
|