1
1
mirror of https://github.com/angristan/wireguard-install.git synced 2024-10-31 18:52:31 +00:00

Merge pull request #106 from angristan/debian-backports

Fix Debian installation: use backports
This commit is contained in:
Stanislas 2020-07-30 11:33:43 +02:00 committed by GitHub
commit c9b01e8d62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -98,6 +98,14 @@ fi
if [[ -e /etc/debian_version ]]; then if [[ -e /etc/debian_version ]]; then
source /etc/os-release source /etc/os-release
OS=$ID # debian or ubuntu OS=$ID # debian or ubuntu
if [[ -e /etc/debian_version ]]; then
if [[ $ID == "debian" || $ID == "raspbian" ]]; then
if [[ $VERSION_ID -ne 10 ]]; then
echo "Your version of Debian ($VERSION_ID) is not supported. Please use Debian 10 Buster"
exit 1
fi
fi
fi
elif [[ -e /etc/fedora-release ]]; then elif [[ -e /etc/fedora-release ]]; then
source /etc/os-release source /etc/os-release
OS=$ID OS=$ID
@ -139,12 +147,13 @@ if [[ $OS == 'ubuntu' ]]; then
apt-get install -y "linux-headers-$(uname -r)" apt-get install -y "linux-headers-$(uname -r)"
apt-get install -y wireguard iptables resolvconf qrencode apt-get install -y wireguard iptables resolvconf qrencode
elif [[ $OS == 'debian' ]]; then elif [[ $OS == 'debian' ]]; then
echo "deb http://deb.debian.org/debian/ unstable main" >/etc/apt/sources.list.d/unstable.list if ! grep -rqs "^deb .* buster-backports" /etc/apt/; then
printf 'Package: *\nPin: release a=unstable\nPin-Priority: 90\n' >/etc/apt/preferences.d/limit-unstable echo "deb http://deb.debian.org/debian buster-backports main" >/etc/apt/sources.list.d/backports.list
apt-get update
fi
apt update apt update
apt-get install -y "linux-headers-$(uname -r)" apt-get install -y iptables resolvconf qrencode
apt-get install -y wireguard iptables resolvconf qrencode apt-get install -y -t buster-backports wireguard
apt-get install -y bc # mitigate https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=956869
elif [[ $OS == 'fedora' ]]; then elif [[ $OS == 'fedora' ]]; then
if [[ $VERSION_ID -lt 32 ]]; then if [[ $VERSION_ID -lt 32 ]]; then
dnf install -y dnf-plugins-core dnf install -y dnf-plugins-core