fix reverse dns

This commit is contained in:
nick committed 2026-07-16 01:14:20 -07:00
1 parent c14be296a8
commit d1ea7aaff2
3 files changed
+26 -4

No files matched your search

+15
View File
@@ -11,4 +11,19 @@ chmod 600 /etc/pam_radius_auth.conf
mkdir -p /var/lib/openvpn
[ -c /dev/net/tun ] || { mkdir -p /dev/net; mknod /dev/net/tun c 10 200; }
# OpenVPN does NOT pass its inherited environment to hook scripts — it
# builds a clean env for them. Hand learn-address.sh its settings via a
# file it sources (the hook runs as nobody after the privilege drop).
sq() { printf '%s' "$1" | sed "s/'/'\\\\''/g"; }
if [ -n "${TECHNITIUM_ADMIN_PASSWORD:-}" ] && [ -n "${VPN_DNS_ZONE:-}" ]; then
{
printf "TECHNITIUM_ADMIN_PASSWORD='%s'\n" "$(sq "$TECHNITIUM_ADMIN_PASSWORD")"
printf "VPN_DNS_ZONE='%s'\n" "$(sq "$VPN_DNS_ZONE")"
} > /etc/openvpn/learn-address.env
chown nobody:nogroup /etc/openvpn/learn-address.env
chmod 400 /etc/openvpn/learn-address.env
else
rm -f /etc/openvpn/learn-address.env
fi
exec openvpn --cd /etc/openvpn --config server.conf