Genera un archivo de texto con información del sistema, como plataforma, kernel, RAM y versiones instaladas de gambas.
Es muy útil para conocer estos datos en caso de problemas. Para usarlo, descarga el código, guarda el archivo y dar permisos de ejecución.
#!/bin/bash
# System Report script for Gambas
# Joshua Higgins
# GPL'd
# Revision 10 26/08/09
OutputFile='gambas_report.log';
echo "System Report for gambas"
# ---------------- DETECT DISTRIBUTION VERSION
# Detection of following distro's is supported
# To add dectection of your favourite distro, format as follows:
# distroshortname:/path/to/version/file
# (generic:/etc/issue should be the LAST entry in the list, as this is the fallback)
distros="ubuntu:/etc/lsb-release vector:/etc/vector-version slackware:/etc/slackware-version debian:/etc/debian_version redhat:/etc/redhat-release arch:/etc/arch-release SuSE:/etc/SuSE-release gentoo:/etc/gentoo-release conectiva:/etc/conectiva-release mandriva:/etc/mandriva-release mandrake:/etc/mandrake-release pardus:/etc/pardus-release kanotix:/etc/kanotix-release generic-undetected:/etc/issue"
for distro in $distros
do
path="`echo $distro | awk -F: '{print $2}'`"
vendor="`echo $distro | awk -F: '{print $1}'`"
# Ubuntu gives an lsb-release file, which needs the info extracting from
if [ "$vendor" = "ubuntu" ]; then
release="`cat $path 2>/dev/null | grep DESCRIPTION | awk -F= '{print $2}'`"
else
release="`cat $path 2>/dev/null`"
fi
if [ "$release" = "" ]; then
message="Still not here..."
# Check if we've missed Arch
if [ -e /etc/arch-release ]; then
vendor="arch"
release="n/a"
echo "Detected distro: $vendor"
break
fi
else
echo "Found distro information at $path!"
echo "Detected distro: $vendor"
break
fi
done
# ---------------- DETECT OS DETAILS
OS=$(uname)
KERNEL=$(uname -r)
# ---------------- DETECT SYSTEM DETAILS
if [ "$OS" = "FreeBSD" ]; then
# Added for FreeBSD RAM detection
RAM=$(echo `sysctl -n hw.physmem` / 1024 | bc -l | cut -d . -f1)" Kb"
else
RAM="`cat /proc/meminfo | grep MemTotal | awk -F: '{print $2}' | sed -e 's/^[ \t]*//'`"
fi
ARCH=$(uname -m)
# ---------------- DETECT gambas DETAILS
GAMBAS=$(gbx -V 2>/dev/null)
GAMBAS2=$(gbx2 -V 2>/dev/null)
GAMBAS3=$(gbx3 -V 2>/dev/null)
GAMBASPATH=$(which gbx 2>/dev/null)
GAMBAS2PATH=$(which gbx2 2>/dev/null)
GAMBAS3PATH=$(which gbx3 2>/dev/null)
# ---------------- PRINT ALL TO FILE
echo "[OperatingSystem]" > $OutputFile
echo "OperatingSystem=$OS" >> $OutputFile
echo "KernelRelease=$KERNEL" >> $OutputFile
echo "DistributionVendor=$vendor" >> $OutputFile
echo "DistributionRelease=$release" >> $OutputFile
echo "" >> $OutputFile
echo "[System]" >> $OutputFile
echo "CPUArchitecture=$ARCH" >> $OutputFile
echo "TotalRam=$RAM" >> $OutputFile
echo "" >> $OutputFile
echo "[gambas]" >> $OutputFile
if [ "$GAMBAS" = "" ]; then
echo "Gambas1=Not Installed" >> $OutputFile
else
echo "Gambas1=$GAMBAS" >> $OutputFile
echo "Gambas1Path=$GAMBASPATH" >> $OutputFile
fi
if [ "$GAMBAS2" = "" ]; then
echo "Gambas2=Not Installed" >> $OutputFile
else
echo "Gambas2=$GAMBAS2" >> $OutputFile
echo "Gambas2Path=$GAMBAS2PATH" >> $OutputFile
fi
if [ "$GAMBAS3" = "" ]; then
echo "Gambas3=Not Installed" >> $OutputFile
else
echo "Gambas3=$GAMBAS3" >> $OutputFile
echo "Gambas3Path=$GAMBAS3PATH" >> $OutputFile
fi
echo "Saved to $OutputFile"
echo "Done."
# System Report script for Gambas
# Joshua Higgins
# GPL'd
# Revision 10 26/08/09
OutputFile='gambas_report.log';
echo "System Report for gambas"
# ---------------- DETECT DISTRIBUTION VERSION
# Detection of following distro's is supported
# To add dectection of your favourite distro, format as follows:
# distroshortname:/path/to/version/file
# (generic:/etc/issue should be the LAST entry in the list, as this is the fallback)
distros="ubuntu:/etc/lsb-release vector:/etc/vector-version slackware:/etc/slackware-version debian:/etc/debian_version redhat:/etc/redhat-release arch:/etc/arch-release SuSE:/etc/SuSE-release gentoo:/etc/gentoo-release conectiva:/etc/conectiva-release mandriva:/etc/mandriva-release mandrake:/etc/mandrake-release pardus:/etc/pardus-release kanotix:/etc/kanotix-release generic-undetected:/etc/issue"
for distro in $distros
do
path="`echo $distro | awk -F: '{print $2}'`"
vendor="`echo $distro | awk -F: '{print $1}'`"
# Ubuntu gives an lsb-release file, which needs the info extracting from
if [ "$vendor" = "ubuntu" ]; then
release="`cat $path 2>/dev/null | grep DESCRIPTION | awk -F= '{print $2}'`"
else
release="`cat $path 2>/dev/null`"
fi
if [ "$release" = "" ]; then
message="Still not here..."
# Check if we've missed Arch
if [ -e /etc/arch-release ]; then
vendor="arch"
release="n/a"
echo "Detected distro: $vendor"
break
fi
else
echo "Found distro information at $path!"
echo "Detected distro: $vendor"
break
fi
done
# ---------------- DETECT OS DETAILS
OS=$(uname)
KERNEL=$(uname -r)
# ---------------- DETECT SYSTEM DETAILS
if [ "$OS" = "FreeBSD" ]; then
# Added for FreeBSD RAM detection
RAM=$(echo `sysctl -n hw.physmem` / 1024 | bc -l | cut -d . -f1)" Kb"
else
RAM="`cat /proc/meminfo | grep MemTotal | awk -F: '{print $2}' | sed -e 's/^[ \t]*//'`"
fi
ARCH=$(uname -m)
# ---------------- DETECT gambas DETAILS
GAMBAS=$(gbx -V 2>/dev/null)
GAMBAS2=$(gbx2 -V 2>/dev/null)
GAMBAS3=$(gbx3 -V 2>/dev/null)
GAMBASPATH=$(which gbx 2>/dev/null)
GAMBAS2PATH=$(which gbx2 2>/dev/null)
GAMBAS3PATH=$(which gbx3 2>/dev/null)
# ---------------- PRINT ALL TO FILE
echo "[OperatingSystem]" > $OutputFile
echo "OperatingSystem=$OS" >> $OutputFile
echo "KernelRelease=$KERNEL" >> $OutputFile
echo "DistributionVendor=$vendor" >> $OutputFile
echo "DistributionRelease=$release" >> $OutputFile
echo "" >> $OutputFile
echo "[System]" >> $OutputFile
echo "CPUArchitecture=$ARCH" >> $OutputFile
echo "TotalRam=$RAM" >> $OutputFile
echo "" >> $OutputFile
echo "[gambas]" >> $OutputFile
if [ "$GAMBAS" = "" ]; then
echo "Gambas1=Not Installed" >> $OutputFile
else
echo "Gambas1=$GAMBAS" >> $OutputFile
echo "Gambas1Path=$GAMBASPATH" >> $OutputFile
fi
if [ "$GAMBAS2" = "" ]; then
echo "Gambas2=Not Installed" >> $OutputFile
else
echo "Gambas2=$GAMBAS2" >> $OutputFile
echo "Gambas2Path=$GAMBAS2PATH" >> $OutputFile
fi
if [ "$GAMBAS3" = "" ]; then
echo "Gambas3=Not Installed" >> $OutputFile
else
echo "Gambas3=$GAMBAS3" >> $OutputFile
echo "Gambas3Path=$GAMBAS3PATH" >> $OutputFile
fi
echo "Saved to $OutputFile"
echo "Done."
Saludos