you dont say what doesnt work - try adding some debug messages in

What OS?

As the script runs as root, there are many things wrong with it anyway. Google for it, there are many many hits