1
0
mirror of https://github.com/balkian/dotfiles.git synced 2024-11-23 12:42:29 +00:00
dotfiles/bin/cpcuevana.sh
J.Fernando Sánchez d8f23e0276 Removed personal-scripts submodule
To make my life a bit easier
2013-06-20 17:54:47 +02:00

14 lines
466 B
Bash
Executable File

#!/bin/bash
# Script to copy Cuevana files to your home directory.
# Tested only with one cuevana instance at a time.
# @author: balkian
destfile="$HOME/VideoCuevana$$"
info=($(lsof -c /npview/i | grep -i /tmp/flash | awk '{print $2; print $9}'))
dir="/proc/${info[0]}/fd"
file=${info[1]}
#echo "pid" $pid
#echo "file" $file
fdn=$(ls -l $dir | grep $file | awk '{print $8}')
cp $dir/$fdn $destfile && echo "Video copied successfully to $destfile." && echo "Enjoy"