#!/bin/sh

HOST=$1;

if [ "x$HOST" = "x" ]; then
    echo "Usage: $0 HOST"
    echo
    echo "Notifies via a KDE popup dialog box when HOST"
    echo "replies to a ping."
    echo
    exit
fi


while ! ping -c 1 $HOST >/dev/null 2>&1; do 
    echo `date` " $HOST is not up."
    sleep 1;
done;

dcop kio_uiserver UIServer messageBox 0 5 "$HOST is up!" "Alert Box" 0 0;
