File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -430,10 +430,15 @@ function needs {
430
430
}
431
431
432
432
# swarm up 00 file uploads file via instances CLI
433
- function up { # port, file
434
- echo " Upload file '$2 ' to node $1 ... " 1>&2
435
- file=` basename $2 `
436
- /usr/bin/time -f " latency: %e" swarm execute $1 " bzz.upload(\" $2 \" , \" $file \" )" | tail -n1> /tmp/key
433
+ function up {
434
+ id=$1
435
+ path=$2
436
+ file=$3
437
+ if [ $file = " " ]; then
438
+ file=` basename $path `
439
+ fi
440
+ echo " Upload file '$path ' to node $id ... " 1>&2
441
+ /usr/bin/time -f " latency: %e" swarm execute $id " bzz.upload(\" $path \" , \" $file \" )" | tail -n1> /tmp/key
437
442
cat /tmp/key
438
443
}
439
444
@@ -590,12 +595,15 @@ function checksum {
590
595
591
596
function checkaccess {
592
597
nodes=$1
598
+ path=$2
593
599
target=` basename $2 `
594
600
chsum=` md5sum $2 | cut -f1 -d' ' `
601
+ shift
602
+ shift
595
603
master=` head -1 $nodes `
596
604
echo " uploading target on $master (md5sum $chsum , size: ` du -b -d0 $2 | cut -f1` )"
597
- scp $2 $master :$target
598
- hash=` swarm remote-run $master " swarm up 00 $target $file " | tr -d ' "' `
605
+ scp $path $master :$target
606
+ hash=` swarm remote-run $master " swarm up 00 $target $* " | tr -d ' "' `
599
607
remote-run $nodes swarm checkdownload all $hash $chsum
600
608
}
601
609
You can’t perform that action at this time.
0 commit comments