All pastes #2124064 Raw Edit

Unnamed

public text v1 · immutable
#2124064 ·published 2012-03-04 19:27 UTC
rendered paste body
matt@entropy:~$ cat bin/fplay
#!/bin/bash

pid=$(pgrep -f libflashplayer.so)

if test -z "$pid"; then
	echo "flash plugin not running" | tee /dev/stderr > /dev/null
	exit 1
fi

files=

for i in /proc/$pid/fd/*; do
	if readlink $i | grep -q ^/tmp/Flash; then
		files="$files $i"
	fi
done

exec mplayer -fs "$@" $files
matt@entropy:~$ cat bin/fcopy
#!/bin/bash

pid=$(pgrep -f libflashplayer.so)

if test -z "$pid"; then
	echo "flash plugin not running" | tee /dev/stderr >/dev/null
	exit 1
fi

if test $# != 2; then
	echo "usage: $0 src-fd dest-file" | tee /dev/stderr >/dev/null
	exit 1
fi

src=/proc/$pid/fd/$1
dest=$2

exec cp "$src" "$dest"