get ips etc

master
root 4 years ago
parent 469add1d16
commit 097bba7aae

@ -0,0 +1,20 @@
#!/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 | \
grep -v -e '^+' -e "CREATED" | \
cut -f 4 -d " "

@ -0,0 +1,22 @@
#!/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[2].address' | \
sed -e 's/"//g'

@ -0,0 +1,22 @@
#!/bin/bash
# eqx-get-deviceid-ip-public
#
# Give a device ID, get public 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[0].address' | \
sed -e 's/"//g'

@ -0,0 +1,22 @@
#!/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'

@ -0,0 +1,18 @@
#!/bin/bash
# eqx-get-project-ssh-config
#
# Give a project name, generate an ~/.ssh/config snippet.
EQXPROJECT="$1"
if [[ $1 == "" ]]
then \
echo -e "Need project name, such as:\n"
eqx-get-project-names
echo
exit
fi
# Get Project Device IDs
eqx-get-project-devices-id "$EQXPROJECT"
Loading…
Cancel
Save