mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
continuous deployment (#2485)
* continuous deployment * fix * escape braces in format string * Update upload-ota.sh * curl fail on http error
This commit is contained in:
22
build/registry/resync.cgi
Normal file
22
build/registry/resync.cgi
Normal file
@@ -0,0 +1,22 @@
|
||||
#!/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"
|
||||
Reference in New Issue
Block a user