1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#!/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" |