mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
* continuous deployment * fix * escape braces in format string * Update upload-ota.sh * curl fail on http error
22 lines
484 B
Bash
22 lines
484 B
Bash
#!/bin/bash
|
|
|
|
declare -A params
|
|
while IFS='=' read -r -d '&' key value && [[ -n "$key" ]]; do
|
|
params["$key"]=$value
|
|
done <<<"${QUERY_STRING}&"
|
|
|
|
index_key="${params['key']}"
|
|
if [ -z "$index_key" ] || [ "$index_key" != "$(cat /var/www/index_key.txt)" ]; then
|
|
echo "HTTP/1.1 401 UNAUTHORIZED"
|
|
echo "Content-Type: text/html"
|
|
echo
|
|
echo "UNAUTHORIZED"
|
|
exit
|
|
fi
|
|
|
|
touch /tmp/resync
|
|
|
|
echo "HTTP/1.1 200 OK"
|
|
echo "Content-Type: text/html"
|
|
echo
|
|
echo "OK: Upload successful" |