Last active 1516600162

A script to fix the Battle.Net Agent crashing constantly on OSX with no warning or error. The elevated instance of Agent dies suddenly, leaving the user-level version doing nothing, with the frozen download meter being the only indication to users

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