Skip to content

Commit

Permalink
upon shutdown we also make sure to disable the remoteapi functionality
Browse files Browse the repository at this point in the history
so that during the shutdown time external systems will receive a 503
status while the APIs are not ready.
  • Loading branch information
jens-maus committed Oct 18, 2023
1 parent 8718822 commit 1a4dc55
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/bin/tclsh

puts "Content-Type: text/plain"
puts "Status: 503"
puts ""
puts -nonewline "Content-Type: text/plain; charset=utf-8\r\n"
puts -nonewline "Status: 503\r\n\r\n"
puts "CCU not ready yet"
7 changes: 7 additions & 0 deletions buildroot-external/overlay/base/etc/init.d/S99SetupLEDs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ stop() {
# source all data from /var/hm_mode
[[ -r /var/hm_mode ]] && . /var/hm_mode

# remove startupFinished and restart lighttpd
# to let it block external APIs again
rm -f /var/status/startupFinished

# reload lighttpd to let it disable the RemoteAPI ports
/etc/init.d/S50lighttpd reload >/dev/null

# if we are in HMLGW mode and are using a RPI-RF-MOD we have
# to set the LED to yellow again to signal shutdown
if [[ "${HM_MODE}" == "HM-LGW" ]]; then
Expand Down

0 comments on commit 1a4dc55

Please sign in to comment.