diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index ea242ae..7666f23 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,9 +4,8 @@
-
+
-
@@ -41,16 +40,16 @@
- {
- "keyToString": {
- "ASKED_ADD_EXTERNAL_FILES": "true",
- "Python.main.executor": "Run",
- "RunOnceActivity.ShowReadmeOnStart": "true",
- "git-widget-placeholder": "main",
- "last_opened_file_path": "/home/punix/Pyapps/wire-py",
- "settings.editor.selected.configurable": "preferences.lookFeel"
+
+}]]>
@@ -235,7 +234,15 @@
1724593165879
-
+
+
+ 1724610514657
+
+
+
+ 1724610514658
+
+
@@ -280,6 +287,7 @@
-
+
+
\ No newline at end of file
diff --git a/wg_func.py b/wg_func.py
index c595d9e..5a337ed 100755
--- a/wg_func.py
+++ b/wg_func.py
@@ -1,7 +1,7 @@
# Wireguard functions for Wire-Py
import os
import shutil
-import tarfile
+from datetime import datetime
from tkinter import filedialog
import tkinter as tk
@@ -225,9 +225,19 @@ class ImportTunnel:
class ExportTunnels:
@staticmethod
def wg_export():
+ now_time = datetime.now()
+ now_datetime = now_time.strftime('/wg-exp-' + "%m-%d-%Y" + '-' + "%H:%M")
+ tl = ListTunnels.tl_list()
try:
- wg_tar = os.environ['HOME'] + '/datetime'
- p_to_conf = os.environ['HOME'] + '/tester'
- shutil.make_archive(wg_tar, 'zip', p_to_conf)
+ if len(tl) != 0:
+ wg_tar = os.environ['HOME'] + now_datetime
+ p_to_conf = os.environ['HOME'] + '/tester'
+ shutil.make_archive(wg_tar, 'zip', p_to_conf)
+ #if zip_full != 0:
+ #print('Export erfolgraeich')
+ #else:
+ #print('ups etwwas ging schief bitte Export wiederholen')
+ else:
+ print('No Tunnel for Export')
except TypeError:
pass