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