23 lines
339 B
Bash
Executable File
23 lines
339 B
Bash
Executable File
#!/bin/bash
|
|
# eqx-get-deviceid-ip-private
|
|
#
|
|
# Give a device ID, get private IP
|
|
|
|
EQXDEVICEID="$1"
|
|
|
|
if [[ $1 == "" ]]
|
|
then \
|
|
echo -e "Need device name"
|
|
echo
|
|
exit
|
|
fi
|
|
|
|
# get IP
|
|
packet \
|
|
device get \
|
|
--json \
|
|
--id $EQXDEVICEID | \
|
|
jq '.ip_addresses[1].address' | \
|
|
sed -e 's/"//g'
|
|
|