-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvncview
executable file
·44 lines (41 loc) · 1.24 KB
/
vncview
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
#
# Set these to the IP address of the VNC Server and the user to login there
# Note: the user needs to have SSH public/private keys setup to automatically
# authenticate and the user must have sudo privileges
#
IP=MM.M.M.MM
USER="__MagicMirror_User__"
# Start VNC Server on MagicMirror
ssh ${USER}@${IP} "export TERM=xterm-256color; sudo systemctl start vncserver-x11-serviced.service"
sleep 3
plat=`uname -s`
if [ "$plat" == "Darwin" ]
then
# Run VNC Viewer on my Mac Pro
"/Applications/VNC Viewer.app/Contents/MacOS/vncviewer" -UserName=${USER} ${IP}
else
inst_vina=`type -p vinagre`
[ "${inst_vina}" ] || {
while true
do
read -p "Vinagre VNC client not found. Install Vinagre ? ('Y'/'N'): " yn
case $yn in
[Yy]*)
sudo apt install vinagre
break
;;
[Nn]*)
echo "Exiting."
exit 0
;;
* )
echo "Please answer yes or no."
;;
esac
done
}
vinagre ${USER}@${IP}
fi
# Stop VNC Server on MagicMirror
ssh ${USER}@${IP} "export TERM=xterm-256color; sudo systemctl stop vncserver-x11-serviced.service"