VBoxSysInfo.sh revision a0ec2c1df51b7654b1e72b112036527d1afa0de3
# Print information about a Linux system
# @param distribution name of the distribution
# @param version version of the distribution
# The following regex is not quite correct for an e-mail address, as
# the local part may not start or end with a dot. Please correct if
# this upsets you.
echo "Distribution: $1 | Version: $2 | Kernel: $kern_ver"
}
# Determine the distribution name and release for a Linux system and print
# send the information to stdout using the print_linux_info function.
# For practical reasons (i.e. lack of time), this function only gives
# information for distribution releases considered "of interest" and reports
# others as unknown. It can be extended later if other distributions are
# found to be "of interest".
if [ -r /etc/lsb-release ] && grep Ubuntu /etc/lsb-release 2>&1 >/dev/null
then
# Ubuntu-based system
. /etc/lsb-release
elif [ -r /etc/debian_version ]
then
# Debian-based system
elif [ -r /etc/mandriva-release ]
then
# Mandriva-based system
elif [ -r /etc/fedora-release ]
then
# Fedora-based
elif [ -r /etc/SuSE-release ]
then
# SUSE-based.
if grep openSUSE /etc/SuSE-release
then
# Is it worth distinguishing here? I did it mainly to prevent
# confusion with the version number
else
fi
elif [ -r /etc/gentoo-release ]
then
# Gentoo-based
elif [ -r /etc/slackware-version ]
then
# Slackware
elif [ -r /etc/arch-release ]
then
# Arch Linux
print_linux_info "Arch Linux" "none"
elif [ -r /etc/redhat-release ]
then
# Redhat-based. This should come near the end, as it other
# distributions may give false positives.
else
print_linux_info "unknown" "unknown"
fi
}
# Print information about a Solaris system. FIXME.
echo "Kernel: $kernel"
}
# Print information about a MacOS system. FIXME.
}
# Print information about a FreeBSD system. FIXME.
echo "Kernel: $kernel"
}
;;
;;
;;
;;
*)
echo "System unknown"
exit 1
;;
esac
exit 0