#!/bin/sh
# Author: Blake, Kuo-Lien Huang
# License: GPL
# Description:
#  remove all file on DRBL clients

# must be root
ID=`id -u`
if [ "$ID" != "0" ]; then
  echo "You must be root to use this script."
  echo "Use sudo to enable it for users."
  exit 1
fi

if [ $# -lt 1 ]; then 
  echo "Usage: $0 file_on_all_drbl_clients_to_remove"
  exit 0
fi

drblhost="/var/lib/diskless/default/"

for host in `ls $drblhost`; do

  if [ "$host" = "." -o "$host" = ".." ]; then continue; fi
  rm -rf $drblhost/$host/$1  

done
