#!/bin/sh set -e PROXY_CONF=/tmp/proxy_forward.caddy # Build basicauth lines from shared users.conf AUTH_LINES="" if [ -f /etc/proxy/users.conf ]; then while IFS=' ' read -r user pass || [ -n "$user" ]; do [ -z "$user" ] && continue case "$user" in \#*) continue ;; esac AUTH_LINES="${AUTH_LINES} basicauth ${user} ${pass}\n" done < /etc/proxy/users.conf fi AUTH_BLOCK=$(printf '%b' "$AUTH_LINES") cat > "$PROXY_CONF" <