11 lines
425 B
Bash
11 lines
425 B
Bash
# Usage: lshost ip-172-28-115-41
|
|
# Ex. Output:
|
|
# Hostname : ip-172-28-115-41 || InstanceID : i-0cf1a535723e25e56
|
|
|
|
function lshost() {
|
|
Hostname=$1
|
|
ICLog=$(sift -rizl --limit=1 --file-matches=InstanceJointStatusMap --ipath=daemons/instance-controller $Hostname | sort | tail -1)
|
|
InstanceID=$(sift -riz --limit=1 $Hostname $ICLog | awk '{print $1}')
|
|
echo Hostname : $Hostname \|\| InstanceID : $InstanceID
|
|
}
|