Results 1 to 4 of 4
Hello everyone, I am looking for a little help with a Bash Script. I have just finished a PC GUI application using Pygtk and glade. But, I would like to ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 04-01-2011 #1
- Join Date
- Apr 2011
BASH Help: Script to check Installed Software
I am looking for a little help with a Bash Script. I have just finished a PC GUI application using Pygtk and glade.
But, I would like to write a Bash Script to check if the user has the needed software to run my application on his or her computer. For example, the software needed to run my application among others are Python, nmap, and pygtk.
which python which nmap
If python or nmap are installed on my computer and I run the above commands, the above code will tell me where it is located.
But if python and nmap are not installed and I run the commands, nothing is displayed.
Could I get a few ideas on how I would go about getting a boolean value to determine whether or not the software is installed or not. I would like to use the boolean value in my bash script to perform other actions ie echo "Python is not installed" or actually install Python if the boolean value is false.
I would really appreciate the help. Thank you for your time.
- 04-01-2011 #2
Imho, the best option is to package your software.
The package (deb/rpm) can then depend on the packages for nmap and python.
This way, the native packagemanager can pull in and install these, and you on the other hand can be sure, that the binaries are there.
That doesn´t mean, you should omit errorchecks completely.
- your package had requested the dependencies
- and your application cannot find nmap and python for the standard $PATH,
then you can stop further efforts to find them.
You can then safely assume, that the user messed with his system.
I would just exit my script/application in that case, complaining about "file not found" or similar.
Last edited by Irithori; 04-01-2011 at 06:41 PM.You must always face the curtain with a bow.
- 04-01-2011 #3
- Join Date
- Apr 2011
Creating a deb package for my application sounds like a great idea. I have found a tutorial but the process seems kind of complicated for a novice like me. I have several .py and .glade files that need to be packaged.
If you have any suggestions or recommendations about how to easily create a deb package, I would greatly appreciate it. I will try to follow the tutorial the best I can.
Once again, thank you Irithori for the help and any other suggestions are welcome.
- 04-02-2011 #4
Sorry, I am more experienced with rpms.
But these seem like good starting points to learn deb packaging:
The Debian GNU/Linux FAQ - Basics of the Debian package management system
Debian New Maintainers' GuideYou must always face the curtain with a bow.