Yum update script with return value
I am trying to automate yum update of specific package on a remote machine.
So far I have this:
# Update my system
if ! yum update w3m
if [ $failure ]
echo "Could not update system." >&2
echo "Update successful"
The script runs fine and shows:
Loading "installonlyn" plugin
Loading "security" plugin
Loading "rhnplugin" plugin
This system is not registered with RHN.
RHN support will be disabled.
Setting up Update Process
Setting up repositories
Reading repository metadata in from local files
Skipping security plugin, no data
Could not find update match for w3m
No Packages marked for Update/Obsoletion
This is OK, but I NEED it to just return the final echo "Update successful".
How can I do this?
Thanks for all the help!