From db0b51228b75b8350a283fa7aff872bffa8f0822 Mon Sep 17 00:00:00 2001 From: Nyr Date: Fri, 15 May 2020 18:19:24 +0200 Subject: [PATCH] Fix TUN device check Fix for the mistaken stderr redirection, sorry about that. Also, run in a subshell so we don't need to manually close the file descriptor. --- openvpn-install.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index c87a88d..e9808a6 100644 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -57,9 +57,7 @@ This version of CentOS is too old and unsupported" exit fi -if [[ -e /dev/net/tun ]] && exec 2>/dev/null 7<>/dev/net/tun; then - exec 7>&- -else +if [[ ! -e /dev/net/tun ]] || ! ( exec 7<>/dev/net/tun ) 2>/dev/null; then echo "This system does not have the TUN device available TUN needs to be enabled before running this installer" exit