Rdp: различия между версиями
Перейти к навигации
Перейти к поиску
Vovan (обсуждение | вклад) (Новая страница: «=Кнопка для меню GNOME3 для запуска xfreerdp= Просто бросьте это в рутовую консоль: <pre> cat << 'EOF' > /…») |
Vovan (обсуждение | вклад) |
||
Строка 17: | Строка 17: | ||
Categories=Development; | Categories=Development; | ||
StartupNotify=true | StartupNotify=true | ||
+ | EOF | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | =Кнопка для меню GNOME3 для запуска remote-viewer= | ||
+ | |||
+ | Окружение | ||
+ | |||
+ | <pre> | ||
+ | SEAT_USER="user" | ||
+ | SEAT_PASSWORD="password" | ||
+ | SEAT_VMID="40101" | ||
+ | </pre> | ||
+ | |||
+ | Кнопка запуска | ||
+ | |||
+ | <pre> | ||
+ | cat << EOF > /usr/share/applications/demoexam-seat-spice.desktop | ||
+ | [Desktop Entry] | ||
+ | Version=1.0 | ||
+ | Type=Application | ||
+ | Name=Demo Exam Seat (SPICE) 1 | ||
+ | GenericName=Demo Exam Seat (SPICE) 1 | ||
+ | Exec=/opt/spice-client.sh "$SEAT_USER" "$SEAT_PASSWORD" "$SEAT_VMID" | ||
+ | Terminal=false | ||
+ | MimeType=text/plain; | ||
+ | Icon= | ||
+ | Categories=Development; | ||
+ | StartupNotify=true | ||
+ | EOF | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | Скрипт | ||
+ | |||
+ | <pre> | ||
+ | cat << 'EOF' > /opt/spice-client.sh | ||
+ | #!/bin/bash | ||
+ | |||
+ | USERNAME="$1" | ||
+ | PASSWORD="$2" | ||
+ | VMID="$3" | ||
+ | PROXY="10.207.151.242" | ||
+ | PORT="8006" | ||
+ | NODE="cluster-node2" | ||
+ | |||
+ | DATA="$(curl -f -s -S -k --data-urlencode "username=$USERNAME" --data-urlencode "password=$PASSWORD" "https://$PROXY:$PORT/api2/json/access/ticket")" | ||
+ | |||
+ | echo "AUTH OK" | ||
+ | |||
+ | TICKET="${DATA//\"/}" | ||
+ | TICKET="${TICKET##*ticket:}" | ||
+ | TICKET="${TICKET%%,*}" | ||
+ | TICKET="${TICKET%%\}*}" | ||
+ | |||
+ | CSRF="${DATA//\"/}" | ||
+ | CSRF="${CSRF##*CSRFPreventionToken:}" | ||
+ | CSRF="${CSRF%%,*}" | ||
+ | CSRF="${CSRF%%\}*}" | ||
+ | |||
+ | curl -f -s -S -k -b "PVEAuthCookie=$TICKET" -H "CSRFPreventionToken: $CSRF" "https://$PROXY:$PORT/api2/spiceconfig/nodes/$NODE/qemu/$VMID/spiceproxy" -d "proxy=$PROXY" > ~/spiceproxy | ||
+ | |||
+ | # -f | ||
+ | exec remote-viewer -f ~/spiceproxy | ||
EOF | EOF | ||
</pre> | </pre> |
Версия 10:13, 3 апреля 2023
Кнопка для меню GNOME3 для запуска xfreerdp
Просто бросьте это в рутовую консоль:
cat << 'EOF' > /usr/share/applications/demoexam-seat.desktop [Desktop Entry] Version=1.0 Type=Application Name=Demo Exam Seat GenericName=Demo Exam Seat Comment= Exec=/usr/bin/xfreerdp /multimon /f /bpp:24 +fonts -compression +auto-reconnect -themes -wallpaper /cert-ignore /u:login /p:password /v:10.207.144.62:33901 Terminal=false MimeType=text/plain; Icon= Categories=Development; StartupNotify=true EOF
Кнопка для меню GNOME3 для запуска remote-viewer
Окружение
SEAT_USER="user" SEAT_PASSWORD="password" SEAT_VMID="40101"
Кнопка запуска
cat << EOF > /usr/share/applications/demoexam-seat-spice.desktop [Desktop Entry] Version=1.0 Type=Application Name=Demo Exam Seat (SPICE) 1 GenericName=Demo Exam Seat (SPICE) 1 Exec=/opt/spice-client.sh "$SEAT_USER" "$SEAT_PASSWORD" "$SEAT_VMID" Terminal=false MimeType=text/plain; Icon= Categories=Development; StartupNotify=true EOF
Скрипт
cat << 'EOF' > /opt/spice-client.sh #!/bin/bash USERNAME="$1" PASSWORD="$2" VMID="$3" PROXY="10.207.151.242" PORT="8006" NODE="cluster-node2" DATA="$(curl -f -s -S -k --data-urlencode "username=$USERNAME" --data-urlencode "password=$PASSWORD" "https://$PROXY:$PORT/api2/json/access/ticket")" echo "AUTH OK" TICKET="${DATA//\"/}" TICKET="${TICKET##*ticket:}" TICKET="${TICKET%%,*}" TICKET="${TICKET%%\}*}" CSRF="${DATA//\"/}" CSRF="${CSRF##*CSRFPreventionToken:}" CSRF="${CSRF%%,*}" CSRF="${CSRF%%\}*}" curl -f -s -S -k -b "PVEAuthCookie=$TICKET" -H "CSRFPreventionToken: $CSRF" "https://$PROXY:$PORT/api2/spiceconfig/nodes/$NODE/qemu/$VMID/spiceproxy" -d "proxy=$PROXY" > ~/spiceproxy # -f exec remote-viewer -f ~/spiceproxy EOF