Skip to content

Instantly share code, notes, and snippets.

@dwallraff
Last active March 2, 2016 22:07
Show Gist options
  • Save dwallraff/89c8f57948d84235ce3d to your computer and use it in GitHub Desktop.
Save dwallraff/89c8f57948d84235ce3d to your computer and use it in GitHub Desktop.
Script to compare your deployed (single) stemcell with the current version of the stemcell
#!/bin/bash
WEB=$(curl -v --silent https://bosh.io/d/stemcells/bosh-azure-hyperv-centos-7-go_agent 2>&1 | grep Location | awk '{print $3}' | cut -d '/' -f 5 | cut -d '-' -f 3)
CUR=$(bosh stemcells 2> /dev/null | grep bosh | awk '{print $6}' | tr -d '*')
if (( $WEB > $CUR )); then
echo "Update stemcell"
else
echo "Stemcell is fine"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment