Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Amazon Linux support #534

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
19 changes: 18 additions & 1 deletion wireguard-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ function checkOS() {
OS=oracle
elif [[ -e /etc/arch-release ]]; then
OS=arch
elif [[ ${ID} == "amzn" ]] || [[ ${ID_LIKE} == *"amzn"* ]]; then
OS=amazon
else
echo "Looks like you aren't running this installer on a Debian, Ubuntu, Fedora, CentOS, AlmaLinux, Oracle or Arch Linux system"
echo "Looks like you aren't running this installer on a Debian, Ubuntu, Fedora, CentOS, AlmaLinux, Oracle, Amazon or Arch Linux system"
exit 1
fi
}
Expand Down Expand Up @@ -204,6 +206,19 @@ function installWireGuard() {
dnf install -y wireguard-tools qrencode iptables
elif [[ ${OS} == 'arch' ]]; then
pacman -S --needed --noconfirm wireguard-tools qrencode
elif [[ ${OS} == 'amazon' ]]; then
# Amazon Linux specific installation
yum update -y
amazon-linux-extras install epel -y
yum install -y wireguard-tools iptables qrencode

# Enable WireGuard kernel module
echo "Enabling WireGuard kernel module..."
modprobe wireguard
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't done by default? 👀

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unnecessary.
I have removed this section and committed.
Thanks!

if ! lsmod | grep -q wireguard; then
echo "Failed to load WireGuard kernel module"
exit 1
fi
fi

# Make sure the directory exists (this does not seem the be the case on fedora)
Expand Down Expand Up @@ -458,6 +473,8 @@ function uninstallWg() {
yum remove --noautoremove wireguard-tools qrencode
elif [[ ${OS} == 'arch' ]]; then
pacman -Rs --noconfirm wireguard-tools qrencode
elif [[ ${OS} == 'amazon' ]]; then
yum remove -y --noautoremove wireguard-tools qrencode
fi

rm -rf /etc/wireguard
Expand Down
Loading