openwrt/ipv4: output peer section at the end

This commit is contained in:
Nico Schottelius 2022-05-02 10:23:16 +02:00
parent 0d7367df9a
commit 1724933e87

View file

@ -24,10 +24,10 @@ public_key=$(echo $private_key | wg pubkey)
case $my_wireguard_ip in
185.155.29.*)
vpn_endpoint_pubkey=6BRnQ+dmeFzVCH9RbM1pbJ7u3y3qrl+zUzzYCmC88kE=
vpn_endpoint_pubkey="6BRnQ+dmeFzVCH9RbM1pbJ7u3y3qrl+zUzzYCmC88kE="
;;
185.155.30.*)
vpn_endpoint_pubkey=5ach7pUQ57aa402LHz1MYh7lyBZS0GvBEw2PC6dMHW4=
vpn_endpoint_pubkey="5ach7pUQ57aa402LHz1MYh7lyBZS0GvBEw2PC6dMHW4="
;;
*)
echo "Unknown VPN host for IP $my_wireguard_ip" >&2
@ -77,4 +77,10 @@ uci commit
EOF
echo "Host ${my_ip} uses ip ${my_wireguard_ip} with public key ${public_key}"
echo "Host ${my_ip} uses ip ${my_wireguard_ip} with public key ${public_key}:"
cat <<EOF
[Peer]
PublicKey = ${public_key}
AllowedIPs = ${my_wireguard_ip}/32
EOF