1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

Add /exit endpoint to monitoring server

Allows terminating chasquid via the network. Useful to trigger a restart
(if there is an init system to relaunch chasquid) and thus reload certificates.

Amended-by: Alberto Bertogli <albertito@blitiri.com.ar>
  Added tests, and adjusted shutdown sequence.
This commit is contained in:
ThinkChaos
2020-10-31 21:46:47 +01:00
committed by Alberto Bertogli
parent e9c6775418
commit bb1b921e3c
4 changed files with 50 additions and 2 deletions

View File

@@ -153,6 +153,15 @@ function wait_for_file() {
done
}
function wait_until() {
while true; do
if eval "$@"; then
return 0
fi
sleep 0.05
done
}
# Generate certs for the given hostname.
function generate_certs_for() {
CONFDIR="${CONFDIR:-config}"