Debian Codegraph @

examples/list-peers

raw
1 #! /bin/bash
2
3 #
4 # Print out all peers in a swarm given a swarm name
5 #
6
7 if [ -z "$1" ]; then
8 echo "Please provide a swarm name to list. Eg. 'com.canonical.DeePeer.Test'" 1>&2
9 exit 1
10 fi
11
12 SWARM_NAME="$1"
13 SWARM_PATH="/com/canonical/dee/peer/$(echo $SWARM_NAME | sed -e 's@\.@/@g')"
14
15 dbus-send --dest=$SWARM_NAME --type=method_call --print-reply $SWARM_PATH com.canonical.Dee.Peer.List