diff --git a/pypia/package_info.json b/pypia/package_info.json index f726c36..ad93a31 100644 --- a/pypia/package_info.json +++ b/pypia/package_info.json @@ -1 +1 @@ -{"install_commands": {"debian": "apt install {}", "ubuntu": "apt install {}", "fedora": "dnf install {}", "arch": "pacman -S {}", "archlabs": "pacman -S {}", "archmerge": "pacman -S {}", "linuxmint": "apt install {}", "opensuse": "zypper install {}", "opensuse-leap": "zypper install {}", "opensuse-tumbleweed": "zypper install {}", "elementary": "apt install {}", "antergos": "pacman -S {}", "manjaro": "pacman -S {}", "kali": "apt install {}", "solus": "eopkg install {}", "centos": "yum install {}"}, "required_packages": {"debian": ["network-manager-openvpn"], "ubuntu": ["network-manager-openvpn", "curl"], "fedora": ["NetworkManager-openvpn"], "linuxmint": ["network-manager-openvpn"], "arch": ["network-manager-applet", "networkmanager-openvpn", "python3"], "archlabs": ["network-manager-applet", "networkmanager-openvpn", "python3"], "archmerge": ["network-manager-applet", "networkmanager-openvpn", "python3"], "opensuse": ["NetworkManager-openvpn"], "opensuse-leap": ["NetworkManager-openvpn"], "opensuse-tumbleweed": ["NetworkManager-openvpn"], "elementary": ["network-manager-openvpn"], "antergos": ["networkmanager-openvpn"], "manjaro": ["networkmanager-openvpn"], "kali": ["network-manager-openvpn","network-manager-openvpn-gnome"], "solus": ["networkmanager-openvpn"], "centos": ["NetworkManager-openvpn"]}} +{"install_commands": {"debian": "apt install {}", "ubuntu": "apt install {}", "fedora": "dnf install {}", "arch": "pacman -S {}", "archlabs": "pacman -S {}", "archmerge": "pacman -S {}", "linuxmint": "apt install {}", "opensuse": "zypper install {}", "opensuse-leap": "zypper install {}", "opensuse-tumbleweed": "zypper install {}", "elementary": "apt install {}", "antergos": "pacman -S {}", "manjaro": "pacman -S {}", "kali": "apt install {}", "solus": "eopkg install {}", "centos": "yum install {}", "gentoo": "emerge {}"}, "required_packages": {"debian": ["network-manager-openvpn"], "ubuntu": ["network-manager-openvpn", "curl"], "fedora": ["NetworkManager-openvpn"], "linuxmint": ["network-manager-openvpn"], "arch": ["network-manager-applet", "networkmanager-openvpn", "python3"], "archlabs": ["network-manager-applet", "networkmanager-openvpn", "python3"], "archmerge": ["network-manager-applet", "networkmanager-openvpn", "python3"], "opensuse": ["NetworkManager-openvpn"], "opensuse-leap": ["NetworkManager-openvpn"], "opensuse-tumbleweed": ["NetworkManager-openvpn"], "elementary": ["network-manager-openvpn"], "antergos": ["networkmanager-openvpn"], "manjaro": ["networkmanager-openvpn"], "kali": ["network-manager-openvpn","network-manager-openvpn-gnome"], "solus": ["networkmanager-openvpn"], "centos": ["NetworkManager-openvpn"], "gentoo": ["net-misc/networkmanager-openvpn"]}} diff --git a/pypia/pypia.py b/pypia/pypia.py index 5a1b7f3..6000cf8 100644 --- a/pypia/pypia.py +++ b/pypia/pypia.py @@ -39,6 +39,7 @@ import tempfile import ssl import logging +from pathlib import Path try: import urllib.request except ImportError: @@ -86,7 +87,11 @@ def install_packages(self): def restart_network_manager(self): print('Restarting network manager...') - subprocess.call(['sudo', 'systemctl', 'restart', 'NetworkManager.service']) + ## Make sure we're actually on a system that is running systemd + if (Path("/bin/systemctl").is_file()): + subprocess.call(['sudo', 'systemctl', 'restart', 'NetworkManager.service']) + else: + subprocess.call(['sudo', 'rc-service', 'NetworkManager', 'restart']) class PiaConfigurations():