I don't know of any way other than to use a bash script to inject the ad code on the files on the server. You might have luck asking over at freewebspace.net, a lot of free hosting webmasters hang out over there and that's the kind of thing they do on their servers. They might know a better way.