Index of /Reseau/Ring

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory  -  


$ type ring-find
ring-find ()
{
  if [ -z "$1" ]; then
    echo "Usage: ${FUNCNAME} as-number";
  else
    # 'nodes' is https://ring.nlnog.net/api/1.0/nodes
    jq -r --argjson var $1 '.results.nodes[] | select(.asn==$var) | .hostname' /home/foo/nlnog-ring/nodes;
  fi
}

ring-ssh ()
{
  if [ -z "$1" ]; then
    echo "Usage: ${FUNCNAME} command";
  else
    dir=/tmp/ring-${1}-$(date +%Y%m%d%H%M);
    mkdir ${dir};
    while read serv; do
      ( ssh -qtt ${serv} "${@}" >> ${dir}/${serv} ) &
    done;
  fi;
}