fix install and .desktop File Tar works now for user home and filebrowser.askfilebrowser start now in user home
This commit is contained in:
@ -9,7 +9,7 @@ from subprocess import check_call
|
||||
|
||||
font_color = '#4011a7'
|
||||
path_to_file = Path('/etc/wire_py/wg_py')
|
||||
|
||||
_u = Path.read_text(Path('/tmp/_u'))
|
||||
|
||||
def msg_window():
|
||||
msg = tk.Toplevel()
|
||||
@ -181,7 +181,7 @@ class ImportTunnel:
|
||||
|
||||
def wg_import_select(self):
|
||||
try:
|
||||
filepath = filedialog.askopenfilename(initialdir='/home/', title='Select Wireguard config File',
|
||||
filepath = filedialog.askopenfilename(initialdir=str(_u), title='Select Wireguard config File',
|
||||
filetypes=[('WG config files', '*.conf')],)
|
||||
|
||||
with open(filepath, 'r') as file:
|
||||
@ -293,13 +293,13 @@ class OnOff:
|
||||
class ExportTunnels:
|
||||
@staticmethod
|
||||
def wg_export():
|
||||
_u = Path.read_text(Path('/tmp/_u'))
|
||||
|
||||
now_time = datetime.now()
|
||||
now_datetime = now_time.strftime('wg-exp-' + '%m-%d-%Y' + '-' + '%H:%M')
|
||||
tl = ListTunnels.tl_list()
|
||||
try:
|
||||
if len(tl) != 0:
|
||||
wg_tar = '/home/' + str(_u) + now_datetime
|
||||
wg_tar = str(_u) + '/' + now_datetime
|
||||
p_to_conf = Path('/etc/wire_py/')
|
||||
shutil.make_archive(wg_tar, 'zip', p_to_conf)
|
||||
#if zip_full != 0:
|
||||
|
Reference in New Issue
Block a user