import datetime for datetime in zip_name a export Tunnel
This commit is contained in:
18
wg_func.py
18
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
|
||||
|
Reference in New Issue
Block a user