#!/bin/bash
#
-# Copyright (C) 2020 Michael Jeanson <mjeanson@efficios.com>
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# SPDX-FileCopyrightText: 2020 Michael Jeanson <mjeanson@efficios.com>
+# SPDX-License-Identifier: GPL-2.0-or-later
set -exu
echo -e "${COLOR_BLUE}$1${COLOR_NONE}"
}
+print_hardware() {
+ if command -v lscpu >/dev/null 2>&1; then
+ print_blue "CPU Details"
+ lscpu
+ fi
+
+ if command -v free >/dev/null 2>&1; then
+ print_blue "Memory Details"
+ free -m
+ else
+ print_blue "Memory Details"
+ vmstat free
+ fi
+
+ print_blue "Storage Details"
+ df -H -T
+}
+
print_os() {
set +ex
print_blue "Selected CC version"
${CC:-cc} --version | head -n1
+ print_blue "Selected CXX version"
+ ${CXX:-c++} --version | head -n1
+
print_blue "Default gcc version"
gcc --version | head -n1
gcc -dumpmachine
+ print_blue "Default g++ version"
+ g++ --version | head -n1
+ g++ -dumpmachine
+
if command -v clang >/dev/null 2>&1; then
print_blue "Default clang version"
clang --version
fi
+ if command -v clang++ >/dev/null 2>&1; then
+ print_blue "Default clang++ version"
+ clang++ --version
+ fi
+
print_blue "git version"
git --version
${TAR:-tar} --version | head -n1
print_blue "Selected python version"
- ${PYTHON} --version
+ ${PYTHON:-python} --version
if command -v "${PYTHON2:-python2}" >/dev/null 2>&1; then
print_blue "python2 version"