You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
590 B
29 lines
590 B
#!/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
|
|
|
|
echo
|
|
echo "# Add to ~/.ssh/config"
|
|
echo "# $EQXPROJECT"
|
|
# For each Device, get hostname and IP
|
|
for EQXDEVICEID in `eqx-get-project-devices-id "$EQXPROJECT"`
|
|
do \
|
|
echo "Host `eqx-get-deviceid-hostname $EQXDEVICEID`"
|
|
echo -e "\tHostname `eqx-get-deviceid-ip-public $EQXDEVICEID`"
|
|
echo -e "\tUser root"
|
|
echo -e "\tPort 22"
|
|
done
|
|
echo
|
|
|