#!/bin/bash # # Create hosts.json with by replacing environment variables in template file # # Define the template file path template_file="/etc/webhook/hook.json.tmpl" # Define the output file path output_file="/etc/webhook/hook.json" # Check if the template file exists if [ ! -f "$template_file" ]; then echo "Template file $template_file not found." exit 1 fi envsubst < "$template_file" > "$output_file" echo "Generated $output_file" # # Start webhooks # echo "Starting webhooks service" exec /usr/local/bin/webhook -verbose -hooks=/etc/webhook/hooks.json -hotreload