X-Git-Url: http://git.grml.org/?p=grml-hwinfo.git;a=blobdiff_plain;f=grml-hwinfo;fp=grml-hwinfo;h=97ad572380bfb9a07c521b15feca24c0bef41bb3;hp=65830801608f55e9c1c705e29f253474decac3f8;hb=e436207fe18500d1ea6d5c22bda6e5b03061bef4;hpb=ea976383121614cddd5da0c3da54a942d6228227 diff --git a/grml-hwinfo b/grml-hwinfo index 6583080..97ad572 100755 --- a/grml-hwinfo +++ b/grml-hwinfo @@ -172,6 +172,22 @@ get_network_devices() { done } +# Check if X server is running +# +# If xset is missing, we rely on the existence of the $DISPLAY variable. +NO_DISPLAY=0 +if exectest xset ; then + if ! timeout 1s xset q &>/dev/null ; then + NO_DISPLAY=1 + fi +elif [ -z "${DISPLAY}" ] ; then + NO_DISPLAY=1 +fi + +if [ "${NO_DISPLAY}" -eq 1 ] ; then + $_opt_quiet || echo "W: Running without X server. Not all data will be collected." +fi + cd "${OUTDIR}" || exit 1 ( if ! $_opt_quiet ; then @@ -191,6 +207,10 @@ cd "${OUTDIR}" || exit 1 fi uname -a > ./uname + # inxi + exectest inxi && inxi -F -xx > ./inxi 2>./inxi.error + exectest inxi && inxi -FJ --admin > ./inxi_admin 2>./inxi_admin.error + # disks / devices [ -f /proc/scsi/scsi ] && cat /proc/scsi/scsi > scsi exectest lspci && lspci -nn > ./lspci @@ -320,7 +340,7 @@ cd "${OUTDIR}" || exit 1 dpkg -S "/boot/vmlinuz-$(uname -r)" >> running_kernel 2>>running_kernel.error # X stuff - if [ -n "${DISPLAY}" ] ; then + if [ "${NO_DISPLAY}" -eq 0 ] ; then exectest xviddetect && xviddetect > ./xviddetect exectest xvidtune && xvidtune -show > ./xdivtune exectest xrandr && xrandr > ./xrandr