fix set rights in install and a .conf a import Tunnel Filedialog Part 1 /home when open

This commit is contained in:
2024-09-19 10:33:45 +02:00
parent 5c06db3681
commit ad59c3ba00
3 changed files with 19 additions and 24 deletions

View File

@ -184,7 +184,7 @@ class ImportTunnel:
filepath = filedialog.askopenfilename(initialdir=Path('/home/'), title='Select Wireguard config '
'File',
filetypes=[('WG config files', '*.conf')], )
os.chmod(filepath, 0o600)
with open(filepath, 'r') as file:
read = file.read()
path_split = filepath.split('/')
@ -224,7 +224,7 @@ class ImportTunnel:
ShowAddress.init_and_report(self, data)
ShowAddress.show_data(self)
check_call(['nmcli', 'con', 'mod', self.a, 'connection.autoconnect', 'no'])
os.chmod(str(wg_read), 0o600)
if 'PrivateKey = ' not in read:
msg_window()
except EOFError: