#!/usr/bin/python3
"""
 This script belongs to wirepy and is for the auto start of the tunnel
"""

from pathlib import Path
from subprocess import check_call

path_to_file = Path(Path.home() / ".config/wire_py/settings")

a_con = Path(path_to_file).read_text(encoding="utf-8").splitlines(keepends=True)
a_con = a_con[7].strip()
if a_con != "off":
    check_call(["nmcli", "connection", "up", a_con])
else:
    pass