mirror of
https://github.com/angristan/openvpn-install.git
synced 2026-08-03 05:08:13 +02:00
Fix shell formatting
This commit is contained in:
+4
-4
@@ -636,7 +636,7 @@ is_valid_ipv4_cidr() {
|
||||
else
|
||||
mask=$(((0xFFFFFFFF << (32 - prefix)) & 0xFFFFFFFF))
|
||||
fi
|
||||
(( (ip & mask) == ip ))
|
||||
(((ip & mask) == ip))
|
||||
}
|
||||
|
||||
expand_ipv6_address() {
|
||||
@@ -698,7 +698,7 @@ is_valid_ipv6_cidr() {
|
||||
((hextets[index] == 0)) || return 1
|
||||
else
|
||||
host_mask=$(((1 << (16 - remaining)) - 1))
|
||||
(( (hextets[index] & host_mask) == 0 )) || return 1
|
||||
(((hextets[index] & host_mask) == 0)) || return 1
|
||||
remaining=0
|
||||
fi
|
||||
done
|
||||
@@ -772,7 +772,7 @@ ipv4_cidrs_overlap() {
|
||||
mask=$(((0xFFFFFFFF << (32 - prefix)) & 0xFFFFFFFF))
|
||||
local first_ip=$(((10#${first_octets[0]} << 24) | (10#${first_octets[1]} << 16) | (10#${first_octets[2]} << 8) | 10#${first_octets[3]}))
|
||||
local second_ip=$(((10#${second_octets[0]} << 24) | (10#${second_octets[1]} << 16) | (10#${second_octets[2]} << 8) | 10#${second_octets[3]}))
|
||||
(( (first_ip & mask) == (second_ip & mask) ))
|
||||
(((first_ip & mask) == (second_ip & mask)))
|
||||
}
|
||||
|
||||
ipv6_cidrs_overlap() {
|
||||
@@ -793,7 +793,7 @@ ipv6_cidrs_overlap() {
|
||||
remaining=$((remaining - 16))
|
||||
else
|
||||
mask=$(((0xFFFF << (16 - remaining)) & 0xFFFF))
|
||||
(( (first_hextets[index] & mask) == (second_hextets[index] & mask) ))
|
||||
(((first_hextets[index] & mask) == (second_hextets[index] & mask)))
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
+18
-18
@@ -693,7 +693,7 @@ echo "Post-renewal client tests passed"
|
||||
if [ "$ROUTE_INTERNET" = "y" ]; then
|
||||
echo "=== Verifying Unbound DNS Resolver ==="
|
||||
|
||||
if [ -f /etc/unbound/unbound.conf ]; then
|
||||
if [ -f /etc/unbound/unbound.conf ]; then
|
||||
# Verify Unbound is running (started by systemctl in install script)
|
||||
echo "Checking Unbound service status..."
|
||||
for _ in $(seq 1 30); do
|
||||
@@ -709,43 +709,43 @@ if [ -f /etc/unbound/unbound.conf ]; then
|
||||
journalctl -u unbound --no-pager -n 50 2>&1 || true
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
else
|
||||
echo "FAIL: /etc/unbound/unbound.conf not found"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "=== Verifying Unbound Installation ==="
|
||||
echo ""
|
||||
echo "=== Verifying Unbound Installation ==="
|
||||
|
||||
# Verify Unbound config exists in conf.d directory
|
||||
UNBOUND_OPENVPN_CONF="/etc/unbound/unbound.conf.d/openvpn.conf"
|
||||
if [ -f "$UNBOUND_OPENVPN_CONF" ]; then
|
||||
# Verify Unbound config exists in conf.d directory
|
||||
UNBOUND_OPENVPN_CONF="/etc/unbound/unbound.conf.d/openvpn.conf"
|
||||
if [ -f "$UNBOUND_OPENVPN_CONF" ]; then
|
||||
echo "PASS: Found Unbound config at $UNBOUND_OPENVPN_CONF"
|
||||
else
|
||||
else
|
||||
echo "FAIL: OpenVPN Unbound config not found at $UNBOUND_OPENVPN_CONF"
|
||||
echo "Contents of /etc/unbound/:"
|
||||
ls -la /etc/unbound/
|
||||
ls -la /etc/unbound/unbound.conf.d/ 2>/dev/null || true
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Verify Unbound listens on VPN gateway
|
||||
if grep -q "interface: $VPN_GATEWAY" "$UNBOUND_OPENVPN_CONF"; then
|
||||
# Verify Unbound listens on VPN gateway
|
||||
if grep -q "interface: $VPN_GATEWAY" "$UNBOUND_OPENVPN_CONF"; then
|
||||
echo "PASS: Unbound configured to listen on $VPN_GATEWAY"
|
||||
else
|
||||
else
|
||||
echo "FAIL: Unbound not configured for $VPN_GATEWAY"
|
||||
cat "$UNBOUND_OPENVPN_CONF"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Verify OpenVPN pushes correct DNS
|
||||
if grep -q "push \"dhcp-option DNS $VPN_GATEWAY\"" /etc/openvpn/server/server.conf; then
|
||||
# Verify OpenVPN pushes correct DNS
|
||||
if grep -q "push \"dhcp-option DNS $VPN_GATEWAY\"" /etc/openvpn/server/server.conf; then
|
||||
echo "PASS: OpenVPN configured to push Unbound DNS"
|
||||
else
|
||||
else
|
||||
echo "FAIL: OpenVPN not configured to push Unbound DNS"
|
||||
grep "dhcp-option DNS" /etc/openvpn/server/server.conf || echo "No DNS push found"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "=== Unbound Installation Verified ==="
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user