#!/bin/sh
#
# Quick hack by Stephen Wynne to collect info for Java trouble-shooters.
#
# Disclaimer: please understand what this script sends its recipient
# before executing. Please don't mail to java-linux for that reason :-)
#
# Usage: sh java-linux-info.sh > /tmp/java-linux-info.out
#         Mail -s "JDK Troubleshooting Output" stevemw@place.org < \
#	    /tmp/java-linux-info.out
#
###############################################################################
#
# $Id: java-linux-info.sh,v 1.6 1998/05/25 00:39:50 stevemw Exp stevemw $
# $Log: java-linux-info.sh,v $
# Revision 1.6  1998/05/25 00:39:50  stevemw
# Fixed name of script.
#
# Revision 1.5  1998/05/23 23:57:11  stevemw
# Added usage instructions.
#
# Revision 1.4  1998/05/22 09:38:28  stevemw
# Simplified.
#
# Revision 1.3  1998/05/22 09:37:54  stevemw
# Added disclaimer.
#

exec 2>&1

die() { echo `basename $0` ERROR: "\`\`$1''" quitting.; exit 1; }

test -z "$DISPLAY" && die "Please type export DISPLAY=:0 first."

echo "Collecting data about your system..."

for c in "date" "uptime" "ls -l /" \
         "printenv" \
         "df" "free" \
         "ldconfig -D" "uname -a" \
         "xdpyinfo" "xset q" "xlsfonts" \
         "hostname --long" "ifconfig -a" \
	 "echo JAVA_HOME=\$JAVA_HOME"  "echo CLASSPATH=\$CLASSPATH"  \
         "echo LD_LIBRARY_PATH=\$LD_LIBRARY_PATH" \
	 "echo Java lives in \`which java\`" "strace -s 128 -f java -version" \
         "sh -x \`which java\`"
do
 echo "---------==| $c |==---------"
 eval $c
done
