aboutsummaryrefslogtreecommitdiff
path: root/wireguard-install.sh
diff options
context:
space:
mode:
authorStanislas Lange <stanislas.lange@pm.me>2020-10-10 15:49:18 +0200
committerStanislas Lange <stanislas.lange@pm.me>2020-10-10 15:49:18 +0200
commitddbaca7fbba20e94f74f0c309c5a061582a0d4fa (patch)
treeb882f8d13b5f69fd2191aa6e525940f75d9147f2 /wireguard-install.sh
parent487aa4fedad8e0b41c59caebe4569b546312c77a (diff)
centos: update installation process
From https://www.wireguard.com/install/. Using kmod instead of dkms. Seems to work without reboot now. Close #118 #111 #147
Diffstat (limited to 'wireguard-install.sh')
-rw-r--r--wireguard-install.sh12
1 files changed, 7 insertions, 5 deletions
diff --git a/wireguard-install.sh b/wireguard-install.sh
index 140dda5..bcdaef8 100644
--- a/wireguard-install.sh
+++ b/wireguard-install.sh
@@ -41,6 +41,7 @@ function checkOS() {
source /etc/os-release
OS="${ID}"
elif [[ -e /etc/centos-release ]]; then
+ source /etc/os-release
OS=centos
elif [[ -e /etc/arch-release ]]; then
OS=arch
@@ -137,9 +138,11 @@ function installWireGuard() {
fi
dnf install -y wireguard-tools iptables qrencode
elif [[ ${OS} == 'centos' ]]; then
- curl -Lo /etc/yum.repos.d/wireguard.repo https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo
- yum -y install epel-release kernel kernel-devel kernel-headers
- yum -y install wireguard-dkms wireguard-tools iptables qrencode
+ yum -y install epel-release elrepo-release
+ if [[ ${VERSION_ID} -eq 7 ]]; then
+ yum -y install yum-plugin-elrepo
+ fi
+ yum -y install kmod-wireguard wireguard-tools iptables qrencode
elif [[ ${OS} == 'arch' ]]; then
# Check if current running kernel is LTS
ARCH_KERNEL_RELEASE=$(uname -r)
@@ -358,8 +361,7 @@ function uninstallWg() {
fi
dnf autoremove -y
elif [[ ${OS} == 'centos' ]]; then
- yum -y remove wireguard-dkms wireguard-tools qrencode
- rm -f "/etc/yum.repos.d/wireguard.repo"
+ yum -y remove kmod-wireguard wireguard-tools qrencode
yum -y autoremove
elif [[ ${OS} == 'arch' ]]; then
pacman -Rs --noconfirm wireguard-tools qrencode