mirror of
https://github.com/Nyr/openvpn-install.git
synced 2024-11-23 21:46:08 +03:00
Small improvements
This commit is contained in:
parent
db0b51228b
commit
e14c2359c8
@ -5,6 +5,9 @@
|
|||||||
# Copyright (c) 2013 Nyr. Released under the MIT License.
|
# Copyright (c) 2013 Nyr. Released under the MIT License.
|
||||||
|
|
||||||
|
|
||||||
|
# Discard stdin. Needed when running from an one-liner which includes a newline
|
||||||
|
read -N 999999999 -t 0.001
|
||||||
|
|
||||||
# Detect Debian users running the script with "sh" instead of bash
|
# Detect Debian users running the script with "sh" instead of bash
|
||||||
if readlink /proc/$$/exe | grep -q "dash"; then
|
if readlink /proc/$$/exe | grep -q "dash"; then
|
||||||
echo "This script needs to be run with bash, not sh"
|
echo "This script needs to be run with bash, not sh"
|
||||||
@ -16,6 +19,12 @@ if [[ "$EUID" -ne 0 ]]; then
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Detect OpenVZ 6
|
||||||
|
if [[ $(uname -r | cut -d "." -f 1) -eq 2 ]]; then
|
||||||
|
echo "The system is running an old kernel, which is incompatible with this installer"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# Detect OS
|
# Detect OS
|
||||||
# $os_version variables aren't always in use, but are kept here for convenience
|
# $os_version variables aren't always in use, but are kept here for convenience
|
||||||
if grep -qs "ubuntu" /etc/os-release; then
|
if grep -qs "ubuntu" /etc/os-release; then
|
||||||
@ -63,6 +72,13 @@ TUN needs to be enabled before running this installer"
|
|||||||
exit
|
exit
|
||||||
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"'
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
new_client () {
|
new_client () {
|
||||||
# Generates the custom client.ovpn
|
# Generates the custom client.ovpn
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user