--- /dev/null
+#!/bin/bash
+
+#
+# cluster administration tool
+#
+# 2010, Razvan Deaconescu, razvan.deaconescu@cs.pub.ro
+#
+
+# source configuration file
+source ./config
+
+verbose=0
+add_keyfile=""
+delete_expr=""
+remoteuser="all"
+remotehost="all"
+vzcontainer="all"
+list=0
+
+list_keys()
+{
+ this_user=$1
+ this_host=$2
+ echo "$this_user@$this_host keys"
+ ssh -l root $this_host "eval cat ~$this_user/.ssh/authorized_keys" | sed 's/ [^ =]*=\+//g' | sed 's/^/ * /g'
+ echo
+}
+
+usage()
+{
+ echo "Usage:" >&2
+ echo -e "\t$0 -h" >&2
+ echo -e "\t$0 [-v] [-r remotehost] [-c vzcontainer] [-u user] -a key" >&2
+ echo -e "\t$0 [-v] [-r remotehost] [-c vzcontainer] [-u user] -d string" >&2
+ echo -e "\t$0 [-v] [-r remotehost] [-c vzcontainer] [-u user] -l" >&2
+}
+
+while getopts "hvr:c:u:a:d:l" option; do
+ case $option in
+ a)
+ add_keyfile="$OPTARG"
+ ;;
+ d)
+ delete_expr="$OPTARG"
+ ;;
+ l)
+ list=1
+ ;;
+ h)
+ usage
+ exit 0
+ ;;
+ v)
+ verbose=1
+ ;;
+ \?)
+ usage
+ exit 1
+ ;;
+ esac
+done
+
+if ! test -z $add_keyfile; then
+ echo "add $add_keyfile"
+fi
+
+if ! test -z $delete_expr; then
+ echo "delete $delete_expr"
+fi
+
+if test $list -eq 1; then
+ if test "$remotehost" == "all"; then
+ echo "yeah"
+ for host in ${remote_hosts[*]}; do
+ if test "$remoteuser" == "all"; then
+ for user in ${remote_users[*]}; do
+ list_keys $user $host
+ done
+ continue
+ fi
+ list_keys $remoteuser $host
+ done
+ else
+ if test "$user" == "all"; then
+ for user in ${remote_users[*]}; do
+ list_keys $user $remotehost
+ done
+ else
+ list_keys $remoteuser $remotehost
+ fi
+ fi
+fi
+
+exit 0
--- /dev/null
+#!/bin/bash
+
+#
+# config file for cluster administration (used by configctl)
+#
+# 2010, Razvan Deaconescu, razvan.deaconescu@cs.pub.ro
+#
+
+remote_hosts=(141.85.224.201 141.85.224.202 141.85.224.203\
+ 141.85.224.204 141.85.224.205 141.85.224.207\
+ 141.85.224.208 141.85.224.210)
+
+remote_users=("p2p" "root")
+
+# IMPORTANT: update root variable; points to script root folder
+root_dir=~/projects/p2p-next/cs-p2p-next/scripts/admin
+
+keys_dir=$root_dir/keys