From b0370f7bb3db5d9937c0b93660edb7e0a28cf1ee Mon Sep 17 00:00:00 2001 From: diijkstra <16804536+diijkstra@users.noreply.github.com> Date: Thu, 19 Mar 2026 19:23:19 +0100 Subject: [PATCH] Doc: Describe how to upload firmware via CLI & HTTP Rough explanation how to upload a new firmware. Probably, we should support basic auth on upload for easier use, but lets document what we have. --- doc/automation.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 doc/automation.md diff --git a/doc/automation.md b/doc/automation.md new file mode 100644 index 0000000..c63ac9b --- /dev/null +++ b/doc/automation.md @@ -0,0 +1,32 @@ +# Automation + +## Upload + +You can automate upload of the firmware via WEB with curl: + +1. Authorize with /login endpoint and save cookie: + + ```bash + curl -c cookies.txt http://${SWITCH_IP}/login -d pwd=${PASSWORD} -i + ``` + + This will save session cookie in cookies.txt +2. Send the firmware via form: + + ```bash + curl -b cookies.txt http://${SWITCH_IP}/upload -F "uploadedfile=@${FIRMWARE_FILE_PATH}" -i + ``` + + You can expect that server will close connection, without responding to request. + Wait for SWITCH_IP to be responding again. + +## Port status + +In similar way to upload, you can fetch the json status of the ports. + +1. Get the session cookie as for upload. +2. Hit the `/status.json` with cookie: + + ```bash + curl -b cookies.txt http://${SWITCH_IP}/status.json + ```