gem=/opt/chef/embedded/bin/gem
chef=/opt/chef/bin/chef-client

if [ "`$chef -v | awk '{print $NF}'`" != "$1" ]; then
  echo "Upgrading Chef to $1...";
  $gem uninstall chef --all --ignore-dependencies --executables
  $gem install chef -v $1 --no-rdoc --no-ri
fi
