So Russel is wondering how to figure out what platform you are on by adding a script or so that will tell you you are on a RPM based machine when trying to run dpkg or tell you you need to use rpm.
Imvho that system is broken .. as everybody with some brains uses apt, even on an rpm based system.