File: seg_new_add

package info (click to toggle)
rccp 0.9-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 244 kB
  • ctags: 44
  • sloc: ansic: 830; sh: 256; perl: 134; makefile: 71
file content (25 lines) | stat: -rwxr-xr-x 551 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
23
24
25
#!/bin/sh
#CCCP script by hampa@chello.se
#this script will first add a new GDL then
#add files to that GDL

#usage: cccp -s somefile | ./seg_new_add

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

#cccp -gn g id1 movie.mpg 526441776


gid=`date +%s`
i=0;

while read -r line
do
if [ $i -eq 0 ]
then
	echo $line | awk -F\| '{printf("%i \"%s\" \"%s\"\n", '$gid', $2, $3)}' | xargs -exec cccp -gn 
	i=1
fi
echo $line | awk -F\| '{printf("'$gid' \"%s\" \"%s\" %s\n", $1, $2, $3)}' | xargs -exec cccp -ga  
done