host_information.sh 435 Bytes
##
# start guessing the system type via uname and export it.
#
gather_host_info() {
	[ -z "${OS}" ] || return

	OS="$(${UNAME} -o)"
	KERNEL="$(${UNAME} -s)"
	VERSION="$(${UNAME} -r)"
	PLATFORM="$(${UNAME} -m)"
	HOSTNAME="$(${UNAME} -n)"
	GNU="$([ "${OS%GNU*}" != ${OS} ] && echo "GNU")"

	export OS KERNEL VERSION PLATFORM HOSTNAME CLASSES

	set_class ${OS} ${GNU} ${KERNEL} ${VERSION} ${PLATFORM} ${HOSTNAME}
}

# vim: set ts=4 sw=4: