@mgpai: thanks for the hint. good sight
@dbrown1986: The script doesn't care about "environment variables" and yes, the previous post shows the missing bracket. I've just tested the exact same script (different path) and working fine.
see pastebin.com/RmHZPg3F