From 8d8c9a7f136c2ddbcb7997541943698a5f3de738 Mon Sep 17 00:00:00 2001 From: hwdsl2 Date: Sat, 4 Jun 2022 23:29:31 -0500 Subject: [PATCH] Update nftables check - The check for nftables is only needed during initial install. --- wireguard-install.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/wireguard-install.sh b/wireguard-install.sh index 290617b..94e3da5 100644 --- a/wireguard-install.sh +++ b/wireguard-install.sh @@ -80,14 +80,6 @@ This version of CentOS is too old and unsupported." exit 1 fi -if [ "$os" = "centos" ]; then - if grep -qs "hwdsl2 VPN script" /etc/sysconfig/nftables.conf \ - || systemctl is-active --quiet nftables 2>/dev/null; then - echo "This system has nftables enabled, which is not supported by this installer." - exit 1 - fi -fi - # Detect environments where $PATH does not include the sbin directories if ! grep -q sbin <<< "$PATH"; then echo '$PATH does not include sbin. Try using "su -" instead of "su".' @@ -191,6 +183,13 @@ EOF } if [[ ! -e /etc/wireguard/wg0.conf ]]; then + if [ "$os" = "centos" ]; then + if grep -qs "hwdsl2 VPN script" /etc/sysconfig/nftables.conf \ + || systemctl is-active --quiet nftables 2>/dev/null; then + echo "This system has nftables enabled, which is not supported by this installer." + exit 1 + fi + fi # Detect some Debian minimal setups where neither wget nor curl are installed if ! hash wget 2>/dev/null && ! hash curl 2>/dev/null; then echo "Wget is required to use this installer."