26 lines
693 B
Python
Executable File
26 lines
693 B
Python
Executable File
#!/usr/bin/python3
|
|
"""
|
|
This script belongs to wirepy and is for the auto start of the tunnel
|
|
"""
|
|
|
|
from subprocess import CompletedProcess, run
|
|
from shared_libs.wp_app_config import AppConfig
|
|
from shared_libs.common_tools import ConfigManager
|
|
from shared_libs.message import MessageDialog
|
|
|
|
ConfigManager.init(AppConfig.SETTINGS_FILE)
|
|
|
|
if ConfigManager.get("autostart") != "off":
|
|
process: CompletedProcess[str] = run(
|
|
["nmcli", "connection", "up", ConfigManager.get("autostart")],
|
|
capture_output=True,
|
|
text=True,
|
|
check=False,
|
|
)
|
|
# Output from start_wg error
|
|
if process.stderr:
|
|
MessageDialog("error", process.stderr).show()
|
|
|
|
else:
|
|
pass
|