#!/bin/sh
#
# This script is run as root before showing login widget.

#xsetroot -solid rgb:8/8/8

(

sleep 2
MYIP="`/sbin/ifconfig eth0 | grep "inet addr" | sed 's/^.*addr:\(.*\)Bcast.*$/\1/'`"
root-tail  -f -fn fixed /var/log/syslog,purple

xmessage -buttons "Current IP $MYIP:10",Reboot:21,Shutdown:20 "" ;
case $? in
 20)
 exec /sbin/poweroff;;
 21)
 exec /sbin/reboot;;
 10)
 exec $0;;
 *)
 echo "Xmessage closed on `date`";;
esac

)&
#--- log messages in background
#root-tail  -f -fn fixed /var/log/messages,purple
#root-tail -f -geometry 500x150-10+10 -fn fixed /var/log/messages,purple

#--- set Shutdown/Reboot buttons
#
#xmessage -buttons Shutdown:20,Reboot:21 "Current IP:$IP" ;
#IP=`/sbin/ifconfig eth0 | grep "inet addr" | sed 's/^.*addr:\(.*\)Bcast.*$/\1/'`

#IP=`/sbin/ifconfig eth0 | grep "inet addr" | sed 's/^.*addr:\(.*\)Bcast.*$/\1/'

#root-tail  -f -fn fixed /var/log/messages,purple;
#(
#xmessage -buttons Shutdown:20,Reboot:21 "Current IP:$IP" ;
#case $? in
# 20)
# exec /sbin/poweroff;;
# 21)
# exec /sbin/reboot;;
# *)
# echo "Xmessage closed on `date`";;
#esac
#)&


#MYIP="`/sbin/ifconfg eth0 | grep "inet addr" | sed 's/^.*addr:\(.*\)Bcast.*$/\1/'`"

#IP=`/sbin/ifconfig eth0 | grep "inet addr" | sed 's/^.*addr:\(.*\)Bcast.*$/\1/'


