Hi folks.
I'm playing around with a raspberry pi and a Tinker board. While essentially the same thing the OSs (Raspbian and Debian) have many differences, as do the libraries for GPIO etc.
In Bash, how can I check the hardware? ie.. If 'command'="Raspberry' DoRaspberry Or a case for a Raspberry pi, Banana pi, Cheesecake, and other boards?
I realise that as the OSs are different and may have to rely on commands failing, or not existing on certain systems. I suppose the easiest way would be for me to drop a file in /dev that each bash could check. Maybe I've just answered my own question!
Even if I have, I'd be interested to know how people would do this if I hadn't just had the genius idea above!!
Many thanks.
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
Which hardware?
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: Which hardware?
Munty Scruntfundle wrote:how can I check the hardware?
Code: Select all
lspci -k
Is that what you mean? I'm not sure I understand your post.
deadbang
Re: Which hardware?
I don't think a robust script should depend on hardware. Instead, I would probably check os and branch from that if necessary.
You're trying to write like a one-size-fits-all script for several gnu/linux distros? Why would they need different commands, is it like a network script that depends on a certain iface, or what? GPIO? can you give an example?
why would you "drop a file in /dev" you could drop a file anywhere, like /tmp I guess, but yeah it's not clear what you're trying to do.
You're trying to write like a one-size-fits-all script for several gnu/linux distros? Why would they need different commands, is it like a network script that depends on a certain iface, or what? GPIO? can you give an example?
why would you "drop a file in /dev" you could drop a file anywhere, like /tmp I guess, but yeah it's not clear what you're trying to do.
resigned by AI ChatGPT