This commit is contained in:
hwdsl2
2022-09-19 21:40:46 -05:00
parent 6cbbca398a
commit f4f7119ae6

View File

@@ -66,7 +66,7 @@ elif [[ -e /etc/fedora-release ]]; then
group_name="nobody"
else
echo "This installer seems to be running on an unsupported distribution.
Supported distros are Ubuntu, Debian, AlmaLinux, Rocky Linux, CentOS and Fedora."
Supported distros are Ubuntu, Debian, AlmaLinux, Rocky Linux, CentOS, Fedora and Amazon Linux 2."
exit 1
fi
@@ -94,8 +94,8 @@ if ! grep -q sbin <<< "$PATH"; then
exit 1
fi
if [[ "$EUID" -ne 0 ]]; then
echo "This installer needs to be run with superuser privileges."
if [ "$(id -u)" != 0 ]; then
echo "This installer must be run as root. Try 'sudo bash $0'"
exit 1
fi
@@ -196,6 +196,9 @@ if [[ ! -e /etc/openvpn/server/server.conf ]]; then
fi
echo
echo 'Welcome to this OpenVPN server installer!'
echo
echo 'I need to ask you a few questions before starting setup.'
echo 'You can use the default options and just press enter if you are OK with them.'
# If system has a single IPv4, it is selected automatically. Else, ask the user
if [[ $(ip -4 addr | grep inet | grep -vEc '127(\.[0-9]{1,3}){3}') -eq 1 ]]; then
ip=$(ip -4 addr | grep inet | grep -vE '127(\.[0-9]{1,3}){3}' | cut -d '/' -f 1 | grep -oE '[0-9]{1,3}(\.[0-9]{1,3}){3}')