File: seg_add

package info (click to toggle)
rccp 0.5-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 164 kB
  • ctags: 40
  • sloc: ansic: 827; sh: 127; perl: 112; makefile: 66
file content (22 lines) | stat: -rwxr-xr-x 507 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
#CCCP script by hampa@chello.se
#add a file to a segment group
#usage: cccp -s somemovie.mpg | ./seg_add gdlid 
#you can see the group id by doing a cccp -gl

#/GDLNEW gdlid|filesize|filename
#/GDLADD gdlid|nickname|remotefilename|remotefilesize 

#cccp -gn gid1 movie.mpg 526441776

if [ $# -eq 0 ]
then
	echo "usage: cccp -s filename | $0 gdlid"
	exit 1;
fi
glid=$1

while read -r line
do
echo $line | awk -F\| '{printf("'$glid' \"%s\" \"%s\" %s\n", $1, $2, $3)}' | xargs -exec cccp -ga  
done