add export Tunnel as zip

This commit is contained in:
2024-08-25 20:28:32 +02:00
parent 980c5a9010
commit 4060a92a0e
3 changed files with 18 additions and 8 deletions

View File

@ -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