forked from raspberrypilearning/teachers-classroom-guide
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvncboot
More file actions
executable file
·37 lines (33 loc) · 889 Bytes
/
vncboot
File metadata and controls
executable file
·37 lines (33 loc) · 889 Bytes
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
## BEGIN INIT INFO
# Provides: vncboot
# 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
#!/bin/sh
#/etc/init.d/vncboot
export USER='pi'
eval cd ~$USER
# Check the state of the command: this'll either be start or stop
case "$1" in
start)
# if it's start, then start vncserver using the details below
echo "Starting VNC for $USER..."
su $USER -c '/usr/bin/tightvncserver :1 -geometry 1280x800'
echo "...done (VNC)"
;;
stop)
# if it's stop, then just kill the process
echo "Stopping VNC for $USER "
su $USER -c '/usr/bin/tightvncserver -kill :1'
echo "...done (VNC)"
;;
*)
echo "Usage: /etc/init.d/vncserver {start|stop}"
exit 1
;;
esac
exit 0