I have a shell script which checks if there is an internet connection (by pinging google), and then calls
yum install packageA packageB --assumeyes
How would I confirm that the packages were installed (or were already installed)? Do I make another yum call and parse the output (I presume this gets very complicated if the system is in another language)?
Based on this random post, it looks like yum returns an error code to the shell. You can test this out by running a command and then immediately (as the next command) doing:
That will print the previous command’s return code. Success should be 0, failure of some kind nonzero. But that’s just a guess since I don’t have a box accessible to me at the moment. 🙂