From 40a2b1580db975275d00289dc3a7de6300076c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Malmstr=C3=B6m?= Date: Wed, 20 Nov 2024 15:35:06 +0100 Subject: [PATCH] Update wireguard.py --- modules/wireguard.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/wireguard.py b/modules/wireguard.py index 7163cbdd..3b2cc698 100644 --- a/modules/wireguard.py +++ b/modules/wireguard.py @@ -6,7 +6,7 @@ import sqlite3 import os import ipcalc - +import sys DB_FILE = '/etc/ipplan.db' @@ -31,11 +31,10 @@ def generate(host, *args): if res: netmask, gatewayip = res + tunnelip = ipcalc.IP(gatewayip) + 4 + tunnelip = str(tunnelip) + '/' + str(netmask) else: netmask, gatewayip = None, None - - tunnelip = ipcalc.IP(gatewayip) + 4 - tunnelip = str(tunnelip) + '/' + str(netmask) info = {} info['current_event'] = current_event