-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathadd-dpu.sh
More file actions
23 lines (17 loc) · 785 Bytes
/
add-dpu.sh
File metadata and controls
23 lines (17 loc) · 785 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
URL="http://127.0.0.1:8080/master/api/1/import/dpu/jar"
#MASTER_USER=master
#MASTER_PASSWORD=commander
echo "---------------------------------------------------------------------"
echo "Installing DPU.."
echo "..target instance: $URL"
echo "---------------------------------------------------------------------"
dpu_file=$(ls $1)
echo -n "..installing $dpu_file: "
outputfile="/tmp/dpu_out.out"
# fire cURL and wait until it finishes
curl --user $MASTER_USER:$MASTER_PASSWORD --fail --silent --output $outputfile -X POST -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -F file=@$dpu_file $URL?force=true
wait $!
# check if the installation went well
outcontents=`cat $outputfile`
echo $outcontents