eqx/eqx-get-deviceid-hostname

22 lines
329 B
Bash
Executable File

#!/bin/bash
# eqx-get-deviceid-hostname
#
# Give a device ID, get hostname
EQXDEVICEID="$1"
if [[ $1 == "" ]]
then \
echo -e "Need device name"
echo
exit
fi
packet \
device get \
--id $EQXDEVICEID \
2>/dev/null | \
grep -v -e '^+' -e "CREATED" | \
cut -f 4 -d " "