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
This commit is contained in:
Stanislas Lange 2020-10-10 15:49:18 +02:00
parent 487aa4feda
commit ddbaca7fbb
No known key found for this signature in database
GPG Key ID: 710D9597C7EAD8CF

View File

@ -41,6 +41,7 @@ function checkOS() {
source /etc/os-release source /etc/os-release
OS="${ID}" OS="${ID}"
elif [[ -e /etc/centos-release ]]; then elif [[ -e /etc/centos-release ]]; then
source /etc/os-release
OS=centos OS=centos
elif [[ -e /etc/arch-release ]]; then elif [[ -e /etc/arch-release ]]; then
OS=arch OS=arch
@ -137,9 +138,11 @@ function installWireGuard() {
fi fi
dnf install -y wireguard-tools iptables qrencode dnf install -y wireguard-tools iptables qrencode
elif [[ ${OS} == 'centos' ]]; then 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 elrepo-release
yum -y install epel-release kernel kernel-devel kernel-headers if [[ ${VERSION_ID} -eq 7 ]]; then
yum -y install wireguard-dkms wireguard-tools iptables qrencode yum -y install yum-plugin-elrepo
fi
yum -y install kmod-wireguard wireguard-tools iptables qrencode
elif [[ ${OS} == 'arch' ]]; then elif [[ ${OS} == 'arch' ]]; then
# Check if current running kernel is LTS # Check if current running kernel is LTS
ARCH_KERNEL_RELEASE=$(uname -r) ARCH_KERNEL_RELEASE=$(uname -r)
@ -358,8 +361,7 @@ function uninstallWg() {
fi fi
dnf autoremove -y dnf autoremove -y
elif [[ ${OS} == 'centos' ]]; then elif [[ ${OS} == 'centos' ]]; then
yum -y remove wireguard-dkms wireguard-tools qrencode yum -y remove kmod-wireguard wireguard-tools qrencode
rm -f "/etc/yum.repos.d/wireguard.repo"
yum -y autoremove yum -y autoremove
elif [[ ${OS} == 'arch' ]]; then elif [[ ${OS} == 'arch' ]]; then
pacman -Rs --noconfirm wireguard-tools qrencode pacman -Rs --noconfirm wireguard-tools qrencode