pheceph: add -version argument to install
[pve-manager.git] / spice-example-sh
1 #!/bin/bash
2
3 # needs pve-manager >= 3.1-44
4
5 USERNAME=root@pam
6 PASSWORD=yoursecretpassword
7 # select VM
8 VMID=100
9
10 NODE=anodename
11 PROXY=anodename.domain.tld
12
13 DATA=`curl -k -d "username=$USERNAME&password=$PASSWORD" https://$PROXY:8006/api2/json/access/ticket`
14
15 TICKET=${DATA//\"/}
16 TICKET=${TICKET##*ticket:}
17 TICKET=${TICKET%%,*}
18
19 CSRF=${DATA//\"/}
20 CSRF=${CSRF##*CSRFPreventionToken:}
21 CSRF=${CSRF%%,*}
22
23 curl -k -b "PVEAuthCookie=$TICKET" -H "CSRFPreventionToken: $CSRF" https://$PROXY:8006/api2/spiceconfig/nodes/$NODE/qemu/$VMID/spiceproxy -d "proxy=$PROXY" > spiceproxy
24
25 remote-viewer spiceproxy