diff --git a/openpyn/__init__.py b/openpyn/__init__.py index ce552d5..e5d466b 100644 --- a/openpyn/__init__.py +++ b/openpyn/__init__.py @@ -3,7 +3,7 @@ import subprocess -__version__ = "2.7.4" +__version__ = "2.7.5" __license__ = "GNU General Public License v3 or later (GPLv3+)" __data_files__ = [] __basefilepath__ = os.path.dirname(os.path.abspath(__file__)) + "/" diff --git a/openpyn/openpyn.py b/openpyn/openpyn.py index a117dae..44e537e 100755 --- a/openpyn/openpyn.py +++ b/openpyn/openpyn.py @@ -240,8 +240,18 @@ def run(init: bool, server: str, country_code: str, country: str, area: str, tcp # check if dependencies are installed if shutil.which("openvpn") is None or shutil.which("wget") is None or shutil.which("unzip") is None: - logger.error("Please Install 'openvpn' 'wget' 'unzip' first") - return 1 + # In case of Debian Sid where "openvpn" is only in root's PATH, don't error out + try: + root_access = root.verify_root_access( + "Sudo credentials required to check if 'openvpn' is available in root's PATH") + if root_access is False: + root.obtain_root_access() + subprocess.check_output(["sudo", "which", "wget"]) + subprocess.check_output(["sudo", "which", "unzip"]) + # subprocess.check_output(["sudo", "which", "openvpn"]) + except subprocess.CalledProcessError: + logger.error("Please Install 'openvpn' 'wget' 'unzip' first") + return 1 elif daemon: if detected_os != "linux": @@ -788,11 +798,14 @@ def get_vpn_server_ip(server: str, port: str) -> str: def uses_systemd_resolved() -> bool: # see https://www.freedesktop.org/software/systemd/man/systemd-resolved.service.html - systemd_resolved_running = subprocess.call( - ["systemctl", "is-active", "systemd-resolved"], - stdout=subprocess.DEVNULL, - stderr=subprocess.DEVNULL, - ) == 0 + try: + systemd_resolved_running = subprocess.call( + ["systemctl", "is-active", "systemd-resolved"], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL, + ) == 0 + except FileNotFoundError: # When OS doesn't find systemctl + return False if not systemd_resolved_running: return False diff --git a/openpyn/scripts/manual-dns-patch.sh b/openpyn/scripts/manual-dns-patch.sh index e4062ba..a668eec 100755 --- a/openpyn/scripts/manual-dns-patch.sh +++ b/openpyn/scripts/manual-dns-patch.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh -nordDNS1="162.242.211.137" -nordDNS2="78.46.223.24" +nordDNS1="103.86.99.100" +nordDNS2="103.86.96.100" openDNS3="208.67.222.220" echo "Changing DNS servers to NordVPN's DNS Servers" diff --git a/setup.py b/setup.py index f97d725..746cedb 100755 --- a/setup.py +++ b/setup.py @@ -25,6 +25,7 @@ 'openvpn wrapper', 'nordvpn', 'nordvpn client', 'secure vpn', 'vpn wrapper', 'private vpn', 'privacy'], install_requires=['requests', 'colorama', 'coloredlogs', 'verboselogs'], + tests_require=['pytest', 'mock'], platforms=['GNU/Linux', 'Ubuntu', 'Debian', 'Kali', 'CentOS', 'Arch', 'Fedora'], packages=setuptools.find_packages(), entry_points={