hamza
Posts: 76
Joined: Fri Apr 03, 2015 7:16 pm

os

Wed May 06, 2015 8:33 am

Hi
how can I detect if the rpi operating system is not raspbian using bash scrpt??

User avatar
joan
Posts: 14887
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: os

Wed May 06, 2015 8:36 am

Parse the contents of /etc/os-release

If the file does not exist you are not running Raspbian.

If the file exists but does not contain the string Raspbian you are not running Raspbian.

Otherwise you are running Raspbian.

User avatar
DougieLawson
Posts: 38883
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: os

Wed May 06, 2015 8:46 am

Some non-Raspbian systems will have /etc/lsb-release and an lsb-release command. You can test for those as well as /etc/os-release
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Beginners”