Check system requirements in installer shell script
Hi, I have a shell script that I would like to update, but I'm still new to writing scripts, and I haven't been able to find what I'm need on Google, so I thought I would ask here. Currently, the script uses curl to download a precompiled tar.bz2, then extracts it (updating previous versions if necessary) and creates a desktop icon.
My question is, how do I update the script to check the minimum system requirements before downloading the archive (specifically the Linux kernel, glib, gtk, etc.)? Any help is appreciated! Thank you! |
I think it would help to state what distribution and package manager you have.
And assuming you're using a package manager is it really necessary to do automated installation of a tarball as opposed to a package? |
You can use 'uname' command output for kernel version. And for glib, gtk, and etc in general you can use package managers description of installed packages.
But it might be a little difficult. As said in previous post you can instead create a package based on the package manager and you will have dependency resolution easily. |
The program I download and extract isn't available through my distro's (Manjaro) repo. The reason I want to have the script check system requirements is so that I can use the script across multiple distros (especially older ones like CentOS 6 and Ubuntu 12.04 for example), and learn something in the process!
Could you elaborate on using the package managers description? If I go that route, would it work across a wide range of distros? Thanks again for any help! |
Well different distros use different package managers.
Read the man pages of 'rpm' and 'dpkg'. |
Do you think something like this (as an example) would work across multiple distros? Or do you think it would be more hassle then it's worth?
Code:
check_dependencies () { |
Quote:
|
All times are GMT -5. The time now is 04:38 AM. |