#!/bin/bash # a script to automate taking a screenshot and system specs. # written by Natan 'whatah' Zohar # inspired by Rajesh 'puthanvartashamaska' Menon # ********************************************************** # this file spits out a .html file with a screenshot and # some of your system specs in it # I would advise running # this in a new directory # and generating an index.html file. # Then you # just move that directory onto a webserver, and # voila, you now have a screenshot page with some system specs HTML_FILE=test_file.html # name of the html file to generate TITLE="my system" # page title XCONFIG_LOCATION=/etc/X11/xorg.conf # location of your x server config FSTAB_LOCATION=/etc/fstab # location of your fstab (probably don't change this) KCONFIG_LOCATION=/boot/kconfig26 # location of your kernel config DISTRO=archlinux # your distro name DISTRO_LINK=http://www.archlinux.org # and a link to your distro DATE=`date +%D | sed 's/\///g'` heading() { TEXT="$@ " echo -n $TEXT >> $HTML_FILE return 0 } text() { TEXT="$@" echo -n " $TEXT " >> $HTML_FILE return 0 } command_link() { COMMAND=$1 OUTFILE=$2 TEXT=$3 $COMMAND > $OUTFILE echo -n " $TEXT " >> $HTML_FILE return 0 } url_link() { TEXT=$1 LINK=$2 echo -n " $TEXT " >> $HTML_FILE } start_paragraph() { echo "

" >> $HTML_FILE } end_paragraph() { echo -e "\n

\n" >> $HTML_FILE } html_init () { echo -e "\n$TITLE\n\n

\n\n

\n" > $HTML_FILE return 0 } html_endit () { echo -e "\n" >> $HTML_FILE return 0 } import -w root scrshot-$DATE.png html_init start_paragraph heading "System";text ":";url_link "`uname -a`" "http://www.kernel.org" end_paragraph start_paragraph heading "Distro";text ":";url_link "$DISTRO" "$DISTRO_LINK" end_paragraph start_paragraph heading "HW specs";text "are";command_link "lspci -v" "lspci.out" "here" end_paragraph start_paragraph heading "Loaded Modules"; text "are"; command_link "lsmod" "lsmod.out" "here"; text " [lsmod]" end_paragraph start_paragraph heading "Kernel Config";text "file";command_link "cat $KCONFIG_LOCATION" "kconfig.out" "here" end_paragraph start_paragraph heading "X Config";command_link "cat $XCONFIG_LOCATION" "xconfig.out" "here" end_paragraph start_paragraph heading "X Info";command_link "xdpyinfo" "xdpyinfo.out" "here" end_paragraph start_paragraph heading "Partitioning";command_link "df -h" "df.out" "here";text "[df -h]" end_paragraph start_paragraph heading "FS";text "setup";command_link "cat $FSTAB_LOCATION" "fstab.out" "here";text "[$FSTAB_LOCATION]" end_paragraph html_endit