diff --git a/wireguard-install.sh b/wireguard-install.sh index 08ffd93..e99caa3 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -24,7 +24,8 @@ if [[ -e /etc/debian_version ]]; then source /etc/os-release OS=$ID # debian or ubuntu elif [[ -e /etc/fedora-release ]]; then - OS=fedora + source /etc/os-release + OS=$ID elif [[ -e /etc/centos-release ]]; then OS=centos elif [[ -e /etc/arch-release ]]; then @@ -93,9 +94,13 @@ elif [[ "$OS" = 'debian' ]]; then apt-get install -y "linux-headers-$(uname -r)" apt-get install -y wireguard iptables resolvconf qrencode elif [[ "$OS" = 'fedora' ]]; then - dnf install -y dnf-plugins-core - dnf copr enable -y jdoss/wireguard - dnf install -y wireguard-dkms wireguard-tools iptables qrencode + if [[ "$VERSION_ID" -ge 32 ]]; then + dnf install -y wireguard-tools iptables qrencode + else + dnf install -y dnf-plugins-core + dnf copr enable -y jdoss/wireguard + dnf install -y wireguard-dkms wireguard-tools iptables qrencode + fi 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