Just want to start with the simple fact that I'm a relative bash newbie and i'm probably doing it wrong.
Anyway, i'm working on a script and I have a program that doesn't always execute reliably due to reasons involving our network. Command works fine, network sometimes causes it to fail. So what i'm trying to do is to incorporate it's execution into a simple loop that forces it to rerun until it's successful. What I have so far is this ...
This isn't working for me at all. I don't have the actual errors at hand unfortunately. Any thoughts on where i've gone wrong?
Anyway, i'm working on a script and I have a program that doesn't always execute reliably due to reasons involving our network. Command works fine, network sometimes causes it to fail. So what i'm trying to do is to incorporate it's execution into a simple loop that forces it to rerun until it's successful. What I have so far is this ...
Code:
#!/bin/bash
errorcode=1
while ( errorcode == 0 )
do
jamf policy -trigger SoftwareInstall
errorcode=$?
if ( errorcode == 0 );
then
echo "Software Install Failed! Rebooting computer to try again ..."
shutdown -r 1
fi
done
This isn't working for me at all. I don't have the actual errors at hand unfortunately. Any thoughts on where i've gone wrong?