aboutsummaryrefslogtreecommitdiff
path: root/wireguard-install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'wireguard-install.sh')
-rw-r--r--wireguard-install.sh15
1 files changed, 9 insertions, 6 deletions
diff --git a/wireguard-install.sh b/wireguard-install.sh
index 8b92f3f..7c0ea87 100644
--- a/wireguard-install.sh
+++ b/wireguard-install.sh
@@ -84,21 +84,24 @@ fi
if [[ "$OS" = 'ubuntu' ]]; then
add-apt-repository ppa:wireguard/wireguard
apt-get update
- apt-get install wireguard
+ apt-get install "linux-headers-$(uname -r)"
+ apt-get install wireguard iptables
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
apt update
- apt install wireguard
+ apt-get install "linux-headers-$(uname -r)"
+ apt install wireguard iptables
elif [[ "$OS" = 'fedora' ]]; then
dnf copr enable jdoss/wireguard
- dnf install wireguard-dkms wireguard-tools
+ dnf install wireguard-dkms wireguard-tools iptables
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 install epel-release
- yum install wireguard-dkms wireguard-tools
+ yum install wireguard-dkms wireguard-tools iptables
elif [[ "$OS" = 'arch' ]]; then
- pacman -S wireguard-tools
+ pacman -S linux-headers
+ pacman -S wireguard-tools iptables
fi
# Make sure the directory exists (this does not seem the be the case on fedora)
@@ -139,7 +142,7 @@ AllowedIPs = 0.0.0.0/0,::/0" >> "$HOME/$SERVER_WG_NIC-client.conf"
# Add pre shared symmetric key to respective files
case "$IS_PRE_SYMM" in
- [yY][eE][sS]|[yY])
+ [yY][eE][sS]|[yY])
CLIENT_SYMM_PRE_KEY=$( wg genpsk )
echo "PresharedKey = $CLIENT_SYMM_PRE_KEY" >> "/etc/wireguard/$SERVER_WG_NIC.conf"
echo "PresharedKey = $CLIENT_SYMM_PRE_KEY" >> "$HOME/$SERVER_WG_NIC-client.conf"