#!/bin/bash

# Enjoy this hack /Peter Bortas

if [ x"$1" = x ]; then
    echo "You need to supply a node name"
    exit 1
fi

# Messes up my mac terminal  /zino
# echo -n "\033]0;Recovery of $1\007"

MYTERM=$TERM
ssh $1 'TERM='$MYTERM' watch -n 1 '"'"'cat /proc/fs/lustre/obdfilter/*OST*/recovery_status /proc/fs/lustre/mdt/*MDT*/recovery_status 2>/dev/null | egrep "status:|time_remaining:|connected_clients:|replayed_requests:|next_transno:|evicted_clients: [^0]"; echo; dmesg | grep evicted | grep -v "waiting for all" || : '"'"''
