conversion to app and configmanager part 2 export still missing

This commit is contained in:
2025-05-19 21:35:14 +02:00
parent d6c20b81f9
commit 55f2119bc3
4 changed files with 206 additions and 223 deletions

View File

@ -3,17 +3,16 @@
This script belongs to wirepy and is for the auto start of the tunnel
"""
from pathlib import Path
import subprocess
from subprocess import CompletedProcess
from wp_app_config import AppConfig
from common_tools import ConfigManager
path_to_file = Path(Path.home() / ".config/wire_py/settings")
ConfigManager.init(AppConfig.SETTINGS_FILE)
a_con = Path(path_to_file).read_text(encoding="utf-8").splitlines(keepends=True)
a_con = a_con[7].strip()
if a_con != "off":
if ConfigManager.get("autostart") != "off":
process: CompletedProcess[str] = subprocess.run(
["nmcli", "connection", "up", a_con],
["nmcli", "connection", "up", ConfigManager.get("autostart")],
capture_output=True,
text=True,
check=False,