1
0
mirror of synced 2024-11-22 13:06:02 +03:00

Check for lsb_release and act upon

Check if lsb_release is installed, if not, do it. It is strictly needed by the script.
This commit is contained in:
Fastidious 2017-03-23 10:45:03 -04:00 committed by GitHub
parent fec47196d6
commit 636c0475cd

View File

@ -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")"