mirror of
https://github.com/Nyr/openvpn-install.git
synced 2024-11-27 15:36:07 +03:00
Improve TUN device check
While it looks hackish, I don't think there's a better way (in Bash) to open the /dev/net/tun character device. Checking for presence of /dev/net/tun like were doing is not good enough.
This commit is contained in:
parent
b392e7da8b
commit
d30e11d019
@ -57,9 +57,11 @@ This version of CentOS is too old and unsupported"
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -e /dev/net/tun ]]; then
|
if [[ -e /dev/net/tun ]] && exec 2>/dev/null 7<>/dev/net/tun; then
|
||||||
echo "The TUN device is not available
|
exec 7>&-
|
||||||
You need to enable TUN before running this script"
|
else
|
||||||
|
echo "This system does not have the TUN device available
|
||||||
|
TUN needs to be enabled before running this installer"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user