feature: improved increase of the last octet of the address for wireguard

This commit is contained in:
Peter Galonza 2025-04-02 23:55:27 +03:00
parent 61f229b5df
commit e74d607a52
No known key found for this signature in database
GPG key ID: C85D94460DBECFA2
3 changed files with 7 additions and 3 deletions

View file

@ -9,7 +9,9 @@ echo $WIREGUARD_SERVER_PUBLIC_KEY > /opt/amnezia/wireguard/wireguard_server_publ
WIREGUARD_PSK=$(wg genpsk)
echo $WIREGUARD_PSK > /opt/amnezia/wireguard/wireguard_psk.key
WIREGUARD_SERVER_IP=$(echo $WIREGUARD_SUBNET_IP | sed 's/\.0$/\.1/')
IFS='.' read -r a b c d <<< "$WIREGUARD_SUBNET_IP"
((d++))
WIREGUARD_SERVER_IP="${a}.${b}.${c}.${d}"
cat > /opt/amnezia/wireguard/wg0.conf <<EOF
[Interface]