It worked well enough to justify learning Rails and Prawn to rewrite the whole thing server side, after which point I rm -rf'ed the directory that script was in and deleted the backup so that its vengeful shade would never trouble humanity again.
Before I heard about configuration management, I had bash scripts to configure my server from clean state. I tried it locally hundreds of times to get every command right.
I automated this with Sikuli (http://sikuli.org/); the ninja feeling while watching it run was awesome (now it runs before I come into the office).
Sikuli made the job perversely fun, and the entire script is less than 100 lines of python. Highly recommended for any sort of GUI automation (though watch the dependency on Java 1.6; 1.7 doesn't work).
That wasn't a fragile system AT ALL.