Last active
December 28, 2020 17:45
-
-
Save denvist/5d1d9eaf3003b706b3c27ff22976183d to your computer and use it in GitHub Desktop.
TeamViewer alternative with Vino-Server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Package: remote-support | |
Version: 1.0 | |
Section: main | |
Priority: optional | |
Architecture: all | |
Depends: coreutils, libglib2.0-bin, vino, zenity | |
Maintainer: UserName <[email protected]> | |
Description: Remote Support | |
Предоставляет удалённый VNC-доступ к компьютеру. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Убиваем предыдущий процесс | |
killall vino-server | |
# Генерируем пароль | |
PASSWD=$(shuf -i 1000-9999 -n 1) | |
PASSWDSTR=$(echo "$PASSWD" | fold -b2 | paste -sd-) | |
# Задаём настройки для Vino | |
gsettings set org.gnome.Vino prompt-enabled true | |
gsettings set org.gnome.Vino notify-on-connect true | |
gsettings set org.gnome.Vino require-encryption false | |
gsettings set org.gnome.Vino use-alternative-port false | |
gsettings set org.gnome.Vino lock-screen-on-disconnect true | |
gsettings set org.gnome.Vino authentication-methods "['vnc']" | |
gsettings set org.gnome.Vino vnc-password $(echo -n "$PASSWD"|base64) | |
# Запускаем vino-сервер | |
/usr/lib/vino/vino-server --sm-disable & | |
# Отображаем пользователю его ip-адрес и пароль для подключения | |
IFACE=$(ip route show default | awk '/default/ {print $5}') | |
IP=$(ip address show $IFACE | awk '/inet / {print $2; exit}' | awk -F \/ '{print $1}') | |
zenity --info --width=300 --height=150 --title="Удалённый помощник" --text="Сообщите специалисту технической поддержки следующие параметры:\n\nАдрес:\t\t$IP\nПароль:\t\t$PASSWDSTR" | |
# Завершаем | |
sleep 30m && killall vino-server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment