#!/bin/bash while true; do ps aux | grep Battle.net | grep Agent | grep root >/dev/null if [[ "$?" -eq "1" ]]; then echo "Fixing Agent at "`date +%H:%M:%S` kill -9 `ps aux | grep Battle.net | grep Agent | grep $USER | awk '{print $2}'` fi sleep 5 done