-
Notifications
You must be signed in to change notification settings - Fork 0
/
vncserver
executable file
·46 lines (40 loc) · 1.33 KB
/
vncserver
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
45
46
#!/bin/sh
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
### BEGIN INIT INFO
# Provides: vncserver
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VNC Server at boot time.
# Description: Start VNC Server at boot time.
### END INIT INFO
USER=pi
HOME=/home/pi
export USER HOME
case "$1" in
start)
echo "Starting VNC Server"
su - pi -c "/usr/bin/vncserver :1 -geometry 1024x768 -depth 16 -pixelformat rgb565"
su - pi -c "/usr/bin/vncserver :2 -geometry 1024x768 -depth 16 -pixelformat rgb565"
su - pi -c "/usr/bin/vncserver :3 -geometry 1024x768 -depth 16 -pixelformat rgb565"
su - pi -c "/usr/bin/vncserver :4 -geometry 1024x768 -depth 16 -pixelformat rgb565"
su - pi -c "/usr/bin/vncserver :5 -geometry 1024x768 -depth 16 -pixelformat rgb565"
;;
stop)
echo "Stopping VNC Server"
/usr/bin/vncserver -kill :1
/usr/bin/vncserver -kill :2
/usr/bin/vncserver -kill :3
/usr/bin/vncserver -kill :4
/usr/bin/vncserver -kill :5
;;
*)
echo "Usage: /etc/init.d/vncserver {start|stop}"
exit 1
;;
esac
exit 0