add Label Interface and Peer to new FrameWidget one and two. when import Tunnel then add to list works and remove of list when Tunnel delete.(with Label active on and off)
add to class and methods open a avtive Tunnel when Wire-Py open, when import and start a Tunnel
This commit is contained in:
10
wg_func.py
10
wg_func.py
@ -20,8 +20,8 @@ class Message(tk.Tk):
|
||||
self.geometry('%dx%d+%d+%d' % (self.x_width, self.y_height, self.monitor_center_x, self.monitor_center_y))
|
||||
self.columnconfigure(0, weight=1)
|
||||
|
||||
self.label = tk.Label(self, image=self.warning_pic, text='Oh... no valid Wireguard File!\nPlease select a '
|
||||
'valid Wireguard File')
|
||||
self.label = tk.Label(self, image=self.warning_pic,
|
||||
text='Oh... no valid Wireguard File!\nPlease select a valid Wireguard File')
|
||||
self.label.config(font=("Ubuntu", 11), padx=15, pady=15)
|
||||
self.label.grid(column=0, row=0)
|
||||
self.button = tk.Button(self, text="OK", command=self.destroy)
|
||||
@ -51,6 +51,7 @@ class ListTunnels:
|
||||
|
||||
class ImportTunnel:
|
||||
def __init__(self):
|
||||
self.select_tunnel = None
|
||||
self.wg_switch = None
|
||||
self.btn_stst = None
|
||||
self.lb_tunnel = None
|
||||
@ -91,6 +92,11 @@ class ImportTunnel:
|
||||
self.lb_tunnel.grid(column=3, row=1, sticky="w")
|
||||
self.btn_stst = tk.Button(self, image=self.wg_vpn_stop, bd=0, command=self.wg_switch)
|
||||
self.btn_stst.grid(column=0, row=1, padx=15, pady=15, sticky="s")
|
||||
wg_read = os.environ['HOME'] + '/tester/' + str(self.a) + '.conf'
|
||||
file = open(wg_read, 'r')
|
||||
read = file.read()
|
||||
file.close()
|
||||
print(read)
|
||||
if "PrivateKey = " not in read:
|
||||
Message()
|
||||
except EOFError:
|
||||
|
Reference in New Issue
Block a user