1 |
8813
|
walker
|
#!/bin/sh
|
2 |
1929
|
brooke
|
|
3 |
8813
|
walker
|
# test-registry-submission.sh
|
4 |
|
|
#
|
5 |
1929
|
brooke
|
#
|
6 |
8813
|
walker
|
# Created by Lauren Walker on 7/23/14.
|
7 |
1929
|
brooke
|
#
|
8 |
|
|
|
9 |
8813
|
walker
|
> fileDetails.txt
|
10 |
|
|
> results.html
|
11 |
3422
|
walbridge
|
|
12 |
8813
|
walker
|
counter="0"
|
13 |
1929
|
brooke
|
|
14 |
8813
|
walker
|
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 |
1929
|
brooke
|
|
18 |
8813
|
walker
|
echo $response >> fileDetails.txt
|
19 |
|
|
counter=$[$counter+1]
|
20 |
|
|
done
|
21 |
1929
|
brooke
|
|
22 |
8813
|
walker
|
counter="0"
|
23 |
1929
|
brooke
|
|
24 |
8813
|
walker
|
while [ $counter -lt 3 ]
|
25 |
|
|
do
|
26 |
|
|
details=$(tail -n+$counter fileDetails.txt | head -n1)
|
27 |
4578
|
walbridge
|
|
28 |
8813
|
walker
|
#Get the variables needed for the confirmation stage
|
29 |
|
|
commaLoc=`gexpr index $details ","`
|
30 |
|
|
upload=${details:0:commaLoc-1}
|
31 |
1929
|
brooke
|
|
32 |
8813
|
walker
|
details=${details:commaLoc}
|
33 |
|
|
commaLoc=`gexpr index $details ","`
|
34 |
|
|
uploadname=${details:0:commaLoc-1}
|
35 |
1929
|
brooke
|
|
36 |
8813
|
walker
|
details=${details:commaLoc}
|
37 |
|
|
commaLoc=`gexpr index $details ","`
|
38 |
|
|
uploadtype=${details:0:commaLoc-1}
|
39 |
2149
|
sgarg
|
|
40 |
8813
|
walker
|
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 |
2152
|
sgarg
|
|
42 |
8813
|
walker
|
counter=$[$counter+1]
|
43 |
|
|
done
|