Moved some linux-only logic from travis config to script.

I'm not sure, but I'll test it out.