#!/usr/bin/env sh
# Disable the EA Origin overlay for Steam games
#
# Dumb shell script but I want to remember the .dll name and this is as good
# a place as any. Also EA sucks.

while getopts h opt; do
    case $opt in
    h) awk 'NR == 1 { next } /^$/ { exit } { print substr($0, 3) }' "$0"
       exit ;;
    esac
done
shift $(( OPTIND - 1 ))

steamdir="${1:-$HOME/Steam}"

find "$steamdir" -name igo64.dll -print0 \
    | xargs -t -r -0 -I{} mv {} {}.orig
