Move all this random code into a main function. Detect unsupported OSes and alert the poor users. :(