1
|
#!/bin/sh
|
2
|
|
3
|
# test-registry-submission.sh
|
4
|
#
|
5
|
#
|
6
|
# Created by Lauren Walker on 7/23/14.
|
7
|
#
|
8
|
|
9
|
> fileDetails.txt
|
10
|
> results.html
|
11
|
|
12
|
counter="0"
|
13
|
|
14
|
while [ $counter -lt 3 ]
|
15
|
do
|
16
|
response=$(curl -X POST --cookie "JSESSIONID=81E77F52A2CA1D632B6CF01925D54FE0;SESS6790668dc29fdba8b64e6f4c1193c83d=yRZg3Ap9kK1TJGef_oOsPu4nMUe_SMEB8ICQrpsuOHI;CGISESSID=5c43858469558146ec0439e5b20500fd" --form file_0=@testdata.csv --form cfg=metacatui --form stage=insert --form providerGivenName=Lauren --form providerSurName=Walker --form "title=test with curl $counter" --form site=NCEAS --form origNamefirst0=walker --form origNamelast0=Walker --form abstract=abstract --form beginningYear=2014 --form geogdesc=Cali --form latDeg1=0 --form longDeg1=0 --form dataMedium=digital --form "useConstraints=no restrictions" --form useOrigAddress=on --form fileCount=1 --form justGetUploadDetails=true "https://dev.nceas.ucsb.edu/knb/cgi-bin/register-dataset.cgi")
|
17
|
|
18
|
echo $response >> fileDetails.txt
|
19
|
counter=$[$counter+1]
|
20
|
done
|
21
|
|
22
|
counter="0"
|
23
|
|
24
|
while [ $counter -lt 3 ]
|
25
|
do
|
26
|
details=$(tail -n+$counter fileDetails.txt | head -n1)
|
27
|
|
28
|
#Get the variables needed for the confirmation stage
|
29
|
commaLoc=`gexpr index $details ","`
|
30
|
upload=${details:0:commaLoc-1}
|
31
|
|
32
|
details=${details:commaLoc}
|
33
|
commaLoc=`gexpr index $details ","`
|
34
|
uploadname=${details:0:commaLoc-1}
|
35
|
|
36
|
details=${details:commaLoc}
|
37
|
commaLoc=`gexpr index $details ","`
|
38
|
uploadtype=${details:0:commaLoc-1}
|
39
|
|
40
|
curl -X POST --cookie "JSESSIONID=81E77F52A2CA1D632B6CF01925D54FE0;SESS6790668dc29fdba8b64e6f4c1193c83d=yRZg3Ap9kK1TJGef_oOsPu4nMUe_SMEB8ICQrpsuOHI;CGISESSID=5c43858469558146ec0439e5b20500fd" --form file_0=@testdata.csv --form cfg=metacatui --form stage=confirmed --form providerGivenName=Lauren --form providerSurName=Walker --form "title=test with curl $counter" --form site=NCEAS --form origNamefirst0=walker --form origNamelast0=Walker --form abstract=abstract --form beginningYear=2014 --form geogdesc=Cali --form latDeg1=0 --form longDeg1=0 --form dataMedium=digital --form "useConstraints=no restrictions" --form useOrigAddress=on --form fileCount=1 --form upCount=1 --form delCount=1 --form uploadperm_0=public --form upload_0=$upload --form uploadname_0=$uploadname --form uploadtype_0=$uploadtype "https://dev.nceas.ucsb.edu/knb/cgi-bin/register-dataset.cgi" &
|
41
|
|
42
|
counter=$[$counter+1]
|
43
|
done
|
44
|
|