@@ -44,13 +44,13 @@ Supported distros are Ubuntu, Debian, AlmaLinux, Rocky Linux, CentOS, Fedora and
44
44
}
45
45
46
46
check_os_ver () {
47
- if [[ " $os " == " ubuntu" && " $os_version " -lt 1804 ]]; then
48
- exiterr " Ubuntu 18 .04 or higher is required to use this installer.
47
+ if [[ " $os " == " ubuntu" && " $os_version " -lt 2004 ]]; then
48
+ exiterr " Ubuntu 20 .04 or higher is required to use this installer.
49
49
This version of Ubuntu is too old and unsupported."
50
50
fi
51
51
52
- if [[ " $os " == " debian" && " $os_version " -lt 10 ]]; then
53
- exiterr " Debian 10 or higher is required to use this installer.
52
+ if [[ " $os " == " debian" && " $os_version " -lt 11 ]]; then
53
+ exiterr " Debian 11 or higher is required to use this installer.
54
54
This version of Debian is too old and unsupported."
55
55
fi
56
56
@@ -646,37 +646,13 @@ if [[ ! -e /etc/wireguard/wg0.conf ]]; then
646
646
apt-get -yqq update || apt-get -yqq update
647
647
apt-get -yqq install wireguard qrencode $firewall > /dev/null
648
648
) || exiterr2
649
- elif [[ " $os " == " debian" && " $os_version " -ge 11 ]]; then
649
+ elif [[ " $os " == " debian" ]]; then
650
650
export DEBIAN_FRONTEND=noninteractive
651
651
(
652
652
set -x
653
653
apt-get -yqq update || apt-get -yqq update
654
654
apt-get -yqq install wireguard qrencode $firewall > /dev/null
655
655
) || exiterr2
656
- elif [[ " $os " == " debian" && " $os_version " -eq 10 ]]; then
657
- if ! grep -qs ' ^deb .* buster-backports main' /etc/apt/sources.list /etc/apt/sources.list.d/* .list; then
658
- echo " deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
659
- fi
660
- export DEBIAN_FRONTEND=noninteractive
661
- (
662
- set -x
663
- apt-get -yqq update || apt-get -yqq update
664
- # Try to install kernel headers for the running kernel and avoid a reboot. This
665
- # can fail, so it's important to run separately from the other apt-get command.
666
- apt-get -yqq install linux-headers-" $( uname -r) " > /dev/null
667
- )
668
- # There are cleaner ways to find out the $architecture, but we require an
669
- # specific format for the package name and this approach provides what we need.
670
- architecture=$( dpkg --get-selections ' linux-image-*-*' | cut -f 1 | grep -oE ' [^-]*$' -m 1)
671
- # linux-headers-$architecture points to the latest headers. We install it
672
- # because if the system has an outdated kernel, there is no guarantee that old
673
- # headers were still downloadable and to provide suitable headers for future
674
- # kernel updates.
675
- (
676
- set -x
677
- apt-get -yqq install linux-headers-" $architecture " > /dev/null
678
- apt-get -yqq install wireguard qrencode $firewall > /dev/null
679
- ) || exiterr2
680
656
elif [[ " $os " == " centos" && " $os_version " -eq 9 ]]; then
681
657
(
682
658
set -x
@@ -803,17 +779,10 @@ WantedBy=multi-user.target" >> /etc/systemd/system/wg-iptables.service
803
779
echo -e ' \xE2\x86\x91 That is a QR code containing the client configuration.'
804
780
echo
805
781
# If the kernel module didn't load, system probably had an outdated kernel
806
- # We'll try to help, but will not force a kernel upgrade upon the user
807
782
if ! modprobe -nq wireguard; then
808
783
echo " Warning!"
809
784
echo " Installation was finished, but the WireGuard kernel module could not load."
810
- if [[ " $os " == " ubuntu" && " $os_version " -eq 1804 ]]; then
811
- echo ' Upgrade the kernel and headers with "apt-get install linux-generic" and restart.'
812
- elif [[ " $os " == " debian" && " $os_version " -eq 10 ]]; then
813
- echo " Upgrade the kernel with \" apt-get install linux-image-$architecture \" and restart."
814
- elif [[ " $os " == " centos" && " $os_version " -le 8 ]]; then
815
- echo " Reboot the system to load the most recent kernel."
816
- fi
785
+ echo " Reboot the system to load the most recent kernel."
817
786
else
818
787
echo " Finished!"
819
788
fi
@@ -1005,18 +974,12 @@ else
1005
974
rm -rf /etc/wireguard/
1006
975
apt-get remove --purge -y wireguard wireguard-tools > /dev/null
1007
976
)
1008
- elif [[ " $os " == " debian" && " $os_version " -ge 11 ]]; then
977
+ elif [[ " $os " == " debian" ]]; then
1009
978
(
1010
979
set -x
1011
980
rm -rf /etc/wireguard/
1012
981
apt-get remove --purge -y wireguard wireguard-tools > /dev/null
1013
982
)
1014
- elif [[ " $os " == " debian" && " $os_version " -eq 10 ]]; then
1015
- (
1016
- set -x
1017
- rm -rf /etc/wireguard/
1018
- apt-get remove --purge -y wireguard wireguard-dkms wireguard-tools > /dev/null
1019
- )
1020
983
elif [[ " $os " == " centos" && " $os_version " -eq 9 ]]; then
1021
984
(
1022
985
set -x
0 commit comments