Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for gentoo and openrc, closing #37 #38

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pypia/package_info.json
Original file line number Diff line number Diff line change
@@ -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"]}}
7 changes: 6 additions & 1 deletion pypia/pypia.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import tempfile
import ssl
import logging
from pathlib import Path
try:
import urllib.request
except ImportError:
Expand Down Expand Up @@ -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():
Expand Down