Created
June 4, 2016 13:17
-
-
Save pmbaumgartner/b897116f50cc9f73430f636523021d48 to your computer and use it in GitHub Desktop.
start vnc server on boot
This file contains 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 | |
# /etc/init.d/vncboot | |
### 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 | |
USER=pi | |
HOME=/home/pi | |
export USER HOME | |
case "$1" in | |
start) | |
echo "Starting VNC Server" | |
#Insert your favoured settings for a VNC session | |
su - $USER -c "/usr/bin/vncserver :1 -geometry 1280x800 -depth 16 -pixelformat rgb565" | |
;; | |
stop) | |
echo "Stopping VNC Server" | |
/usr/bin/vncserver -kill :1 | |
;; | |
*) | |
echo "Usage: /etc/init.d/vncboot {start|stop}" | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment