updated put script and publication added
[martlubbers.net.git] / put.bash
1 #!/bin/bash
2 set -e
3 files=$(find . -type f -not -iwholename "*.git*" -not -name "README.md" -not -name "put.bash" -not -name "hashes.txt")
4 user=ftp@martlubbers.net:$(pass ftp.martlubbers.net/ftp@martlubbers.net)
5
6 for f in $files
7 do
8 origmd5=$(grep "$f" ./hashes.txt | awk '{print $1}')
9 currmd5=$(md5sum "$f" | awk '{print $1}')
10 if [ "$origmd5" = "$currmd5" ]
11 then
12 echo "$f is not changed"
13 else
14 echo "$f is changed"
15 curl -u "$user" -T $f ftp://martlubbers.net/public_html/$f
16 fi
17 done
18 md5sum ./*{,/*} > ./hashes.txt || true