24 lines
515 B
Bash
Executable File
24 lines
515 B
Bash
Executable File
#!/bin/bash
|
|
md5files=$(cat .uploaded)
|
|
|
|
IP=prototype-esp.lan
|
|
if [ "$#" != 0 ]; then
|
|
IP="$1"
|
|
fi
|
|
|
|
# upload all *.py files and the second argument
|
|
for i in $(ls *.py $2 )
|
|
do
|
|
if [[ $md5files != *"$(md5sum $i | cut -d' ' -f1)"* ]]; then
|
|
echo $(md5sum $i)
|
|
webrepl_cli.py -p asdf $i $IP:/$i
|
|
# If upload was successful, update md5sum
|
|
if [ $? -eq 0 ]; then
|
|
md5files=$(echo $md5files | sed 's|:\([^:]*\)'"$i"'||g'):$(md5sum "$i")
|
|
echo "$md5files" > .uploaded
|
|
else
|
|
echo "not uploaded!"
|
|
fi
|
|
fi
|
|
done
|