Skip to content

Commit

Permalink
Merge pull request #194 from jotyGill/test
Browse files Browse the repository at this point in the history
Version 2.7.5
  • Loading branch information
jotyGill authored Sep 13, 2018
2 parents eb3cc1d + ddbffe7 commit 7f42c3c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion openpyn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)) + "/"
Expand Down
27 changes: 20 additions & 7 deletions openpyn/openpyn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions openpyn/scripts/manual-dns-patch.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={
Expand Down

0 comments on commit 7f42c3c

Please sign in to comment.