Browse Source

Get facility with device ID

master
Jeff Moe 10 months ago
parent
commit
9370e974fc
  1. 30
      eqx-get-deviceid-facility

30
eqx-get-deviceid-facility

@ -0,0 +1,30 @@
#!/bin/bash
# eqx-get-deviceid-facility
#
# Give a device ID, get facility
EQXDEVICEID="$1"
if [[ $1 == "" ]]
then \
echo -e "Need device ID"
echo -e "To get device IDs in a project, run:"
echo -e "eqx-get-project-devices [project name]"
echo
exit
fi
packet \
device get \
--json \
--id $EQXDEVICEID \
2>/dev/null | \
jq '.facility.code' | \
sed -e 's/"//g'
exit
--id $EQXDEVICEID \
2>/dev/null | \
grep -v -e '^+' -e "CREATED" | \
cut -f 4 -d " "
Loading…
Cancel
Save