Skip to content
This repository has been archived by the owner on Feb 16, 2020. It is now read-only.

Fixing errors with linux-headers in debian 9 #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions wireguard-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,21 @@ if [ ! -f "$WG_CONFIG" ]; then
elif [ "$DISTRO" == "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
apt-get install software-properties-common -y
apt update
apt install linux-headers-$(uname -r) wireguard qrencode iptables-persistent -y
apt update
apt-get install software-properties-common -y
apt install linux-headers-$(uname -r) -y && \
apt install wireguard qrencode iptables-persistent -y || \
{
echo "Unable to find linux-headers for this kernel!"
echo "Please upgrade kernel first and reboot, then run install again"
read -p "Update kernel automatically? [y/n]: " -e -i "y" CONFIRM
if [ "$CONFIRM" == "y" ]; then
apt-get install linux-image-amd64 linux-headers-amd64 -y && reboot
else
echo "Please update kernel: apt-get install linux-image-amd64 linux-headers-amd64"
exit
fi
}
elif [ "$DISTRO" == "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 install epel-release -y
Expand Down