Created
March 5, 2018 20:29
-
-
Save jcvenegas/ed889943a5aea3fc42d7b6c4f3bc1a45 to your computer and use it in GitHub Desktop.
Get agent version from Clear Contaienrs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
img="" | |
loop="" | |
cleanup() { | |
if [ -n "$img" ];then | |
sudo umount /mnt || true | |
fi | |
if [ -n "$loop" ];then | |
sudo losetup -d ${loop} || true | |
fi | |
} | |
trap cleanup EXIT | |
img=$(cc-runtime cc-env | grep 'Path = ".*.img"' | cut -d '"' -f 2) | |
loop=$(sudo losetup -fP --show $img) | |
sudo mount ${loop}p1 /mnt/ | |
/mnt/bin/cc-agent 2>&1 | grep '"version":' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment