#!/bin/bash echo "Entered" dcopRef=`kdialog --progressbar "MythTV will shut down the System. Press Cancel to Abort" 60` dcop $dcopRef showCancelButton true until test "true" == `dcop $dcopRef wasCancelled`; do sleep 1 inc=$((`dcop $dcopRef progress` + 1)) dcop $dcopRef setProgress $inc; if test $inc == 60; then dcop $dcopRef close exit 0 fi done dcop $dcopRef close exit 2