From 636c0475cdec04c17716dde4f36e00167fb4314e Mon Sep 17 00:00:00 2001 From: Fastidious Date: Thu, 23 Mar 2017 10:45:03 -0400 Subject: [PATCH] Check for lsb_release and act upon Check if lsb_release is installed, if not, do it. It is strictly needed by the script. --- vpnsetup.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/vpnsetup.sh b/vpnsetup.sh index dca0e84..95d5489 100755 --- a/vpnsetup.sh +++ b/vpnsetup.sh @@ -46,6 +46,13 @@ check_ip() { printf %s "$1" | tr -d '\n' | grep -Eq "$IP_REGEX" } +if [ ! -x /usr/bin/lsb_release ] +then + echo "The lsb_release command was not found." >&2 + echo "Installing lsb-release, Please Wait..." + apt-get -y install lsb-release || exiterr2 +fi + os_type="$(lsb_release -si 2>/dev/null)" if [ -z "$os_type" ] && [ -f "/etc/lsb-release" ]; then os_type="$(. /etc/lsb-release && echo "$DISTRIB_ID")"