#!/bin/sh
pidfile=steam.pid
for tmp_option in $@
do
        # Extract options and values (format: option=value):
        option=${tmp_option%%=*}
        value=${tmp_option#*=}
        [ "$option" == "$tmp_option" ] && value=
        # Check options:
        [ "$option" == "--pid" ] && pidfile=$value
        [ "$option" == "--pidfile" ] && pidfile=$value
done
[ -e "$pidfile" ] && kill `cat $pidfile`
[ -e "$pidfile" ] && rm -f "$pidfile"
