Packages zenity and xterm must be installed.
The script:
#!/bin/sh
zenity --question --text "Would you like to check and install updates?"
if [ $? = 0 ];
then
xterm -e 'sudo yum update && sleep 5' && zenity --info --text "System Upgraded"
else exit 0
fi