Skip to main content
Glama
apply_policies910 B
#!/bin/bash set -e # Function to calculate the hash of the two files together calculate_hash() { sha256sum /etc/haproxy/allowed_domains.lst /etc/haproxy/blocked_domains.lst | sha256sum | awk '{print $1}' } # Capture the initial hash INITIAL_HASH=$(calculate_hash) /usr/bin/setenv > /dev/null # Capture the new hash after running setenv NEW_HASH=$(calculate_hash) # Reload HAProxy configuration only if there are changes in the files if [ "$INITIAL_HASH" != "$NEW_HASH" ]; then /usr/bin/reload_tls_passthrough HAPROXY_MASTER_PID=$(pgrep -o haproxy) # -o flag gets the oldest process, which is typically the master if [[ "$HAPROXY_MASTER_PID" =~ ^[0-9]+$ ]]; then kill -HUP "$HAPROXY_MASTER_PID" || true fi fi /command/s6-envdir /var/run/lunar_env /usr/bin/reload_exporters wget --content-on-error -q --post-data '' -O - http://localhost:$ENGINE_ADMIN_PORT/apply_policies 2>&1

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/TheLunarCompany/lunar'

If you have feedback or need assistance with the MCP directory API, please join our Discord server