@@ -61,8 +61,10 @@ function checkOS() {
61
61
OS=oracle
62
62
elif [[ -e /etc/arch-release ]]; then
63
63
OS=arch
64
+ elif [[ ${ID} == " amzn" ]] || [[ ${ID_LIKE} == * " amzn" * ]]; then
65
+ OS=amazon
64
66
else
65
- echo " Looks like you aren't running this installer on a Debian, Ubuntu, Fedora, CentOS, AlmaLinux, Oracle or Arch Linux system"
67
+ echo " Looks like you aren't running this installer on a Debian, Ubuntu, Fedora, CentOS, AlmaLinux, Oracle, Amazon or Arch Linux system"
66
68
exit 1
67
69
fi
68
70
}
@@ -204,6 +206,19 @@ function installWireGuard() {
204
206
dnf install -y wireguard-tools qrencode iptables
205
207
elif [[ ${OS} == 'arch' ]]; then
206
208
pacman -S --needed --noconfirm wireguard-tools qrencode
209
+ elif [[ ${OS} == 'amazon' ]]; then
210
+ # Amazon Linux specific installation
211
+ yum update -y
212
+ amazon-linux-extras install epel -y
213
+ yum install -y wireguard-tools iptables qrencode
214
+
215
+ # Enable WireGuard kernel module
216
+ echo "Enabling WireGuard kernel module..."
217
+ modprobe wireguard
218
+ if ! lsmod | grep -q wireguard; then
219
+ echo "Failed to load WireGuard kernel module"
220
+ exit 1
221
+ fi
207
222
fi
208
223
209
224
# Make sure the directory exists (this does not seem the be the case on fedora)
@@ -458,6 +473,8 @@ function uninstallWg() {
458
473
yum remove --noautoremove wireguard-tools qrencode
459
474
elif [[ ${OS} == 'arch' ]]; then
460
475
pacman -Rs --noconfirm wireguard-tools qrencode
476
+ elif [[ ${OS} == 'amazon' ]]; then
477
+ yum remove -y --noautoremove wireguard-tools qrencode
461
478
fi
462
479
463
480
rm -rf /etc/wireguard
0 commit comments