detect-distro.sh: more general detection strategies