Skip to content

Instantly share code, notes, and snippets.

@blha303
Created January 22, 2018 15:49
Show Gist options
  • Save blha303/d78070a370acf2b0948bba22cf35bc30 to your computer and use it in GitHub Desktop.
Save blha303/d78070a370acf2b0948bba22cf35bc30 to your computer and use it in GitHub Desktop.
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
#!/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment