Fix Issue #5.
The problem was that the chmod operation ran asynchronously and you weren't waiting for the end of this execution. This caused the intermittent fault where sometimes we had permission to execute it and sometimes we didn't.
I've included a check for 0 return code for good measure.
Fix Issue #5. The problem was that the chmod operation ran asynchronously and you weren't waiting for the end of this execution. This caused the intermittent fault where sometimes we had permission to execute it and sometimes we didn't. I've included a check for 0 return code for good measure.