add export Tunnel as zip
This commit is contained in:
parent
980c5a9010
commit
4060a92a0e
15
.idea/workspace.xml
generated
15
.idea/workspace.xml
generated
@ -4,7 +4,7 @@
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="remove a ',' in DNS Name">
|
||||
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment="fix when Filname > 17 first copy file after rename">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/wg_func.py" beforeDir="false" afterPath="$PROJECT_DIR$/wg_func.py" afterDir="false" />
|
||||
@ -227,7 +227,15 @@
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1724576599289</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="18" />
|
||||
<task id="LOCAL-00018" summary="fix when Filname > 17 first copy file after rename">
|
||||
<option name="closed" value="true" />
|
||||
<created>1724593165879</created>
|
||||
<option name="number" value="00018" />
|
||||
<option name="presentableId" value="LOCAL-00018" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1724593165879</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="19" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
@ -271,6 +279,7 @@
|
||||
<MESSAGE value="little fixes in Class Import" />
|
||||
<MESSAGE value="fix label when laat Tunnel delete and fix Tuple error in delete and Start/Stop when listbox empty" />
|
||||
<MESSAGE value="remove a ',' in DNS Name" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="remove a ',' in DNS Name" />
|
||||
<MESSAGE value="fix when Filname > 17 first copy file after rename" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="fix when Filname > 17 first copy file after rename" />
|
||||
</component>
|
||||
</project>
|
2
main.py
2
main.py
@ -138,7 +138,7 @@ class FrameWidgets(ttk.Frame):
|
||||
self.btn_tr = tk.Button(self, image=self.tr_pic, bd=0, command=delete)
|
||||
self.btn_tr.grid(column=0, row=3, padx=15, pady=15)
|
||||
# Button Export
|
||||
self.btn_exp = tk.Button(self, image=self.exp_pic, bd=0)
|
||||
self.btn_exp = tk.Button(self, image=self.exp_pic, bd=0, command=ExportTunnels.wg_export)
|
||||
self.btn_exp.grid(column=0, row=4, padx=15, pady=15)
|
||||
# Check Buttons
|
||||
self.wg_autostart = tk.Checkbutton(self, text='Autoconnect on PC Start')
|
||||
|
@ -1,6 +1,7 @@
|
||||
# Wireguard functions for Wire-Py
|
||||
import os
|
||||
import shutil
|
||||
import tarfile
|
||||
from tkinter import filedialog
|
||||
import tkinter as tk
|
||||
|
||||
@ -225,8 +226,8 @@ class ExportTunnels:
|
||||
@staticmethod
|
||||
def wg_export():
|
||||
try:
|
||||
wg_exp = os.popen('nmcli con show | grep -iPo "(.*)(wireguard)"').read().split()
|
||||
wg_exp = wg_exp[1]
|
||||
return wg_exp
|
||||
except IndexError:
|
||||
wg_tar = os.environ['HOME'] + '/datetime'
|
||||
p_to_conf = os.environ['HOME'] + '/tester'
|
||||
shutil.make_archive(wg_tar, 'zip', p_to_conf)
|
||||
except TypeError:
|
||||
pass
|
||||
|
Loading…
x
Reference in New Issue
Block a user