Blinky/uploadfs.sh

18 lines
884 B
Bash
Raw Permalink Normal View History

2022-08-30 19:17:10 +00:00
#!/bin/sh
2022-11-24 17:35:50 +00:00
exit 0 # Disabled
2022-08-30 19:24:37 +00:00
echo "Running"
2022-08-30 19:17:10 +00:00
while read line
2022-08-30 19:04:57 +00:00
do
2022-08-30 19:17:10 +00:00
echo "Line is ${line}"
2022-09-06 19:38:48 +00:00
curhost=$(echo ${line} | cut -d ',' -f1)
curip=$(echo ${line} | cut -d ',' -f2)
2022-08-30 19:04:57 +00:00
echo "Host ${curhost} and IP ${curip}"
2022-08-30 19:34:50 +00:00
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
2022-08-30 19:17:10 +00:00
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)