#!/bin/bash ############################################################################## # Script-Name : sysinfo4wp # # Description : Script zur Erstellung eines Bildschirmhintergrundes mit # # den wichtigsten Systemparametern # # # # Last update : 2012-01-05 # # Version : 0.02 # ############################################################################## ############################################################################## # H I S T O R Y # ############################################################################## # Version : 0.01 # # Description : initial release # # -------------------------------------------------------------------------- # # Version : 0.02 # # Description : Bootzeitpunktberechnung berücksichtigt, Dank an fischi # ############################################################################## # Definition der Variablen FILE="/usr/share/backgrounds/default.jpg" # Bildschirmhintergrund in dem die Ausgabe eingebettet werden soll WALLPAPER="/usr/share/backgrounds/new_blue.jpg" # Name unseres neu erstellten Bildschirmhintergrundes TMPFILE="/tmp/sysinfo_4_WP" PRG=/usr/bin/convert # Variablen für die ermittelten Parameter HOST=$(hostname) RELEASE=`cat /etc/redhat-release` KERNEL=`uname -r` KERNELVERSION="Linux Version "$KERNEL IPT=$(/sbin/ifconfig eth0 | head -n 2 | tail -n 1 | cut -d: -f2 | cut -d" " -f 1) IPADRESSET="IP Adresse (eth0): "$IPT # ggf. weitere Netzwerkschnittstellen definieren #IPU=$(/sbin/ifconfig ppp0 | head -n 2 | tail -n 1 | cut -d: -f2 | cut -d" " -f 1) #IPADRESSEU="IP Adresse (ppp0): "$IPU UPTIME=`uptime | grep '' /proc/uptime | awk '{ print $1 }'` UPTIME=`echo "$UPTIME" | sed 's/\(.*\)...$/\1/'` let BOOTDATE=`date +%s`-$UPTIME BOOTDATE="Bootzeitpunkt: "`date -d @$BOOTDATE "+%d.%m.%y - %H:%M Uhr"` CPU_COUNT=`cat /proc/cpuinfo | grep -cA 0 processor` CPU_MODEL=`cat /proc/cpuinfo | grep -m 1 model.name | sed 's/^model.name*.:*.//'` CPU_SPEED=`cat /proc/cpuinfo | grep -m 1 cpu.MHz | sed 's/^cpu.MHz*.:*.//' | sed 's/^:*.//'` CPU="$CPU_COUNT x $CPU_MODEL" MEM=`grep MemTotal /proc/meminfo` # Hintergrundbild erstellen $PRG -gravity southwest -fill white -pointsize 35 -draw 'text 50,320 Systemübersicht' $FILE $WALLPAPER $PRG -gravity southwest -fill white -pointsize 30 -draw "text 50,270 '$HOST'" $WALLPAPER $WALLPAPER $PRG -gravity southwest -fill white -pointsize 20 -draw "text 50,230 '$CPU'" $WALLPAPER $WALLPAPER $PRG -gravity southwest -fill white -pointsize 20 -draw "text 50,200 '$MEM'" $WALLPAPER $WALLPAPER $PRG -gravity southwest -fill white -pointsize 20 -draw "text 50,160 '$RELEASE'" $WALLPAPER $WALLPAPER $PRG -gravity southwest -fill white -pointsize 20 -draw "text 50,135 '$KERNELVERSION'" $WALLPAPER $WALLPAPER # ggf. weiters Netzwerkinterface anzeigen lassen #$PRG -gravity southwest -font /usr/share/fonts/bitstream-vera/VeraBd.ttf -fill white -pointsize 20 -draw "text 50,110 '$IPADRESSEU'" $WALLPAPER $WALLPAPER $PRG -gravity southwest -fill white -pointsize 20 -draw "text 50,85 '$IPADRESSET'" $WALLPAPER $WALLPAPER $PRG -gravity southwest -fill white -pointsize 20 -draw "text 50,50 '$BOOTDATE'" $WALLPAPER $WALLPAPER