#!/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 debian" echo -e "\tPort 22" done echo