diff options
author | Stanislas <stanislas.lange@pm.me> | 2020-07-30 11:33:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-30 11:33:43 +0200 |
commit | c9b01e8d62ba6eac15b1c6705fb2ebd6c9683aeb (patch) | |
tree | 69d3f8a7a4076efec1fc9db30c45c375aaaaa7b1 | |
parent | b6f09e7e878cf4abb7ff2aca0bc4cf622f952f1f (diff) | |
parent | 6e518633f340b8281f032ed47d07f61b4d91fe59 (diff) |
Merge pull request #106 from angristan/debian-backports
Fix Debian installation: use backports
-rw-r--r-- | wireguard-install.sh | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/wireguard-install.sh b/wireguard-install.sh index 3dfcb07..b05c6b8 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -98,6 +98,14 @@ fi if [[ -e /etc/debian_version ]]; then source /etc/os-release 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 source /etc/os-release OS=$ID @@ -139,12 +147,13 @@ if [[ $OS == 'ubuntu' ]]; then apt-get install -y "linux-headers-$(uname -r)" apt-get install -y wireguard iptables resolvconf qrencode elif [[ $OS == 'debian' ]]; then - echo "deb http://deb.debian.org/debian/ unstable main" >/etc/apt/sources.list.d/unstable.list - printf 'Package: *\nPin: release a=unstable\nPin-Priority: 90\n' >/etc/apt/preferences.d/limit-unstable + if ! grep -rqs "^deb .* buster-backports" /etc/apt/; then + echo "deb http://deb.debian.org/debian buster-backports main" >/etc/apt/sources.list.d/backports.list + apt-get update + fi apt update - apt-get install -y "linux-headers-$(uname -r)" - apt-get install -y wireguard iptables resolvconf qrencode - apt-get install -y bc # mitigate https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=956869 + apt-get install -y iptables resolvconf qrencode + apt-get install -y -t buster-backports wireguard elif [[ $OS == 'fedora' ]]; then if [[ $VERSION_ID -lt 32 ]]; then dnf install -y dnf-plugins-core |