[ILUG] Shell script

Frank Murphy frankly3d at gmail.com
Wed Nov 16 17:31:45 GMT 2011


Trying to adapt a shell script to do a yum check-update,
as since Gnome3,
xfce no longer has a working gnome-packagekit (depends on gnome-shell)

---------------------------------------------------------
#!/bin/bash

updates=$( yum check-update )

if [ $? = 100 ]
then
echo -e "<img>/usr/share/icons/oxygen/32x32/emblems/emblem-new.png</img>"
echo -e "<tool>Updates Available</tool>"
echo -e "<click>gpk-update-viewer</click>"
else
fi
---------------------------------------------------------

If theres updates, we get an icon.
No updates, want nothing. (only visible if updates)

Syntax error line 12 "fi"

Had a quickkie look at:
http://sgpit.com/shellscripting/
but couldn't see an "if else nothing"

-- 
Regards,

Frank Murphy
UTF_8 Encoded
Friend of fedoraproject.org


More information about the ILUG mailing list