Created
August 20, 2014 17:19
-
-
Save bsdlp/5bc08b2099bc0ecec2ef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
BOOT_ID="fake-client-018" | |
MACHINE_ID="fake-machine-018" | |
VERSION="394.0.0" | |
# Fill in default values | |
: ${COREOS_RELEASE_APPID:="{e96281a6-d1af-4bde-9a0a-97b76e56dc57}"} | |
: ${SERVER:="https://public.update.core-os.net/v1/update/"} | |
: ${GROUP:="alpha"} | |
: ${OEM_ID:="diskless"} | |
fill_attrs() { | |
echo -n "appid=\"${COREOS_RELEASE_APPID}\" " | |
echo -n "oem=\"${OEM_ID}\" " | |
echo -n "version=\"${VERSION}\" " | |
echo -n "track=\"${GROUP}\" " | |
echo -n "bootid=\"{${BOOT_ID}}\" " | |
# other UUID's are surrounded by {} but not machineid | |
echo -n "machineid=\"${MACHINE_ID}\" " | |
echo -n "lang=\"en-US\" " | |
echo -n "hardware_class=\"\" " | |
echo -n "delta_okay=\"false\" " | |
} | |
BODY="<?xml version=\"1.0\" encoding=\"UTF-8\"?> | |
<request protocol=\"3.0\" version=\"CoreOSUpdateEngine-0.1.0.0\" updaterversion=\"CoreOSUpdateEngine-0.1.0.0\" installsource=\"scheduler\" ismachine=\"1\"> | |
<os version=\"Chateau\" platform=\"CoreOS\" sp=\"${VERSION}\"></os> | |
<app $(fill_attrs) > | |
<event eventtype=\"3\" eventresult=\"2\" previousversion=\"\"></event> | |
</app> | |
</request>" | |
echo Request: "${BODY}" | |
curl -H "text/xml" -X POST -d "${BODY}" "${SERVER}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment