Follow

Is there like a dichotomous tree or decision tree process for identifying which linux distro your (non-root) script is running on? No cheating by looking at root-owned files, assuming a fair amount of user-code isolation is in place to rule-out the obvious options (lsb-release and similair commands), etc.

@thufie some distros put their name in e.g. `uname -a`?

Other than that I think you’d need to look through /etc for something indicative of a specific distro family.

Like, if you’re able to, look for the presence of apt or apk or pacman configuration files or what have you

Then check their configs to narrow it down based on the repositories in use.

@thufie but that might be cheating based on your definition above. And it would of course be fooled by a container or chroot

Sign in to participate in the conversation
Pixietown

Small server part of the pixie.town infrastructure. Registration is closed.