Greetings Bart, As I said earlier in the thread, this problem can be easily replicated (just do the simple bash script I did earlier in the thread and use it in a computer that needs to update the flash plug in - it stalls and fails).
This should, in my opinion, convince you about looking into it, because if you have a problem that is replicable, and you don't understand what the problem is, you will never know how grave it is, or in which other circumstances it will impact the code or the result. What is wrong with it I can't tell because I have no time to study your code. But my guesses are that it is related to permissions (this script was called via gksudo) or something related with the output to the screen. Cheers, Jamil