Blinky/uploadfs.sh

17 lines
870 B
Bash

#!/bin/sh
echo "Running"
while read line
do
echo "Line is ${line}"
curhost = $(echo ${line} | cut -d ',' -f1)
curip = $(echo ${line} | cut -d ',' -f2)
echo "Host ${curhost} and IP ${curip}"
curl -m 180 --insecure --no-progress-meter --fail-with-body --request POST --url "https://espota.ctdo.de/" --header "Content-Type: multipart/form-data" --form ip="$curip" --form spiffs=@.pio/build/d1_mini/spiffs_${curhost}.bin --no-buffer
done < <(cat lastknownhostips)
#!/bin/bash
#while IFS="," read -r curhost curip
#do
# echo "Host ${curhost} and IP ${curip}"
# # Upload this image
# curl --insecure --no-progress-meter --fail-with-body --request POST --url "https://espota.ctdo.de/" --header "Content-Type: multipart/form-data" --form ip="$curip" --form spiffs=@.pio/build/d1_mini/spiffs_${curhost}.bin --no-buffer
#done < <(cat lastknownhostips)