- Fix a ConToDict Class when Endpoint not in Wireguard config file #20

Merged
punix merged 1 commits from 1.10.2024 into main 2024-10-20 12:20:41 +02:00
2 changed files with 4 additions and 5 deletions
Showing only changes of commit 0fe591d70c - Show all commits

View File

@ -4,10 +4,9 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment=" - Add Options, Help, Update Label and Update Menubutton &#10; - Theme now separate Light and Dark">
<list default="true" id="940e1630-c825-4d4c-be80-bc11f543c122" name="Changes" comment=" - Add Options, Help, Update Label and Update Menubutton&#10; - Theme now separate Light and Dark&#10; - Add Own Tooltip (Class and def's) Part One">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wg_func.py" beforeDir="false" afterPath="$PROJECT_DIR$/wg_func.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/wg_main.py" beforeDir="false" afterPath="$PROJECT_DIR$/wg_main.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />

View File

@ -13,7 +13,7 @@ import requests
''' 1 = 1. Year, 09 = Month of the Year, 2924 = Day and Year of the Year '''
version = 'v. 1.10.1924'
version = 'v. 1.10.2024'
path_to_file = Path('/etc/wire_py/wg_py')
path_to_file2 = Path('/etc/wire_py/settings')
@ -315,7 +315,7 @@ class ImportTunnel:
path_split1 = path_split[-1]
self.a = TunnelActiv.active()
if 'PrivateKey = ' in read and 'PublicKey = ' in read:
if 'PrivateKey = ' in read and 'PublicKey = 'in read and 'Endpoint =' in read:
with open(filepath, 'r') as file:
key = ConToDict.covert_to_dict(file)
pre_key = key[3]
@ -373,7 +373,7 @@ class ImportTunnel:
check_call(['nmcli', 'con', 'mod', self.a, 'connection.autoconnect', 'no'])
Path.chmod(wg_read, 0o600)
if 'PrivateKey = ' not in read:
if 'PrivateKey = ' and 'Endpoint = ' not in read:
"""img_w, img_i, w_title, w_txt hand over"""
iw = r'/usr/share/icons/wp-icons/64/error.png'
ii = r'/usr/share/icons/wp-icons/48/wg_msg.png'