diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 433002f..5c45740 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,9 +4,8 @@
-
+
-
@@ -195,7 +194,15 @@
1724401340512
-
+
+
+ 1724410630021
+
+
+
+ 1724410630021
+
+
@@ -235,6 +242,7 @@
-
+
+
\ No newline at end of file
diff --git a/wg_func.py b/wg_func.py
index f5800c6..ae6ab57 100644
--- a/wg_func.py
+++ b/wg_func.py
@@ -181,16 +181,17 @@ class ImportTunnel:
if len(pathsplit1) > 17:
pathsplit = pathsplit1[len(pathsplit1) - 17:]
os.rename(filepath, os.environ['HOME'] + '/tester/' + str(pathsplit))
- os.system('nmcli connection down ' + str(TunnelActiv.active()))
+ if self.a != '':
+ os.system('nmcli connection down ' + str(TunnelActiv.active()))
os.system('nmcli connection import type wireguard file ' + os.environ['HOME'] + '/tester/' +
str(pathsplit))
- os.system('nmcli con mod ' + str(pathsplit[:-5]) + ' connection.autoconnect no')
else:
subprocess.call('cp ' + str(filepath) + ' ' + os.environ['HOME'] + '/tester/', shell=True)
- os.system('nmcli connection down ' + str(TunnelActiv.active()))
+ if self.a != '':
+ os.system('nmcli connection down ' + str(TunnelActiv.active()))
os.system('nmcli connection import type wireguard file ' + str(filepath))
- os.system('nmcli con mod ' + str(pathsplit1[:-5]) + ' connection.autoconnect no')
- self.StrVar.set(value=' ')
+
+ self.StrVar.set('')
self.a = TunnelActiv.active()
self.l_box.insert(0, self.a)
self.l_box.update()
@@ -201,11 +202,11 @@ class ImportTunnel:
wg_read = os.environ['HOME'] + '/tester/' + str(self.a) + '.conf'
file = open(wg_read, 'r')
data = ConToDict.covert_to_dict(file)
- self.add.set('Address: ' + data[0])
- self.DNS.set(' DNS: ' + data[1])
- self.enp.set('Endpoint: ' + data[2])
+ # Address Label
+ ShowAddress.init_and_report(self, data)
ShowAddress.show_data(self)
file.close()
+ os.system('nmcli con mod ' + str(self.a) + ' connection.autoconnect no')
if "PrivateKey = " not in read:
Message()
except EOFError: