All,
I'm having fighting a losing battle with what I though would be simple.
My goal is this: Show a zenity progress or info dialog until the system obtains an ip address, then close the dialog and continue through the rest of the script.
Right now I've got the following:
ip=`ifconfig | grep 'inet ' | grep -v -c '127.0.0.1'`
just grabbing the number of ip addresses.
if [ $ip -eq 0 ]; then
while [ $ip -eq 0 ]
do
ip=$(ifconfig | grep 'inet ' | grep -v -c '127.0.0.1')
zenity --info --no-wrap --text "You are not currently connected to the internet. Please check your router and connections"
else
pkill zenity
done
fi
Now I thought I was dictating that if the number of ip addresses is 0, keep checking until it isn't; also show a zenity dialog. Then, when the number no longer equals 0, exit the loop and kill the zenity box. With the exception of zenity automatically closing, everything else works, as if I switch to echoing right in the terminal it works perfectly. I think this could be useful for a lot of different applications requiring user action, but not requiring an explicit "ok" from the user after the action has been taken.
Anyone care to educate me?
---------- Post updated 10-25-12 at 10:09 AM ---------- Previous update was 10-24-12 at 06:11 PM ----------
Bump.
Have I stumped this forum as well?