Skip to content

Instantly share code, notes, and snippets.

@maditnerd
Created December 20, 2012 22:03
Show Gist options
  • Save maditnerd/4348937 to your computer and use it in GitHub Desktop.
Save maditnerd/4348937 to your computer and use it in GitHub Desktop.
Installe un serveur VNC cd /tmp wget smarturl.it/vnc chmod +x /tmp/vnc ./vnc
#/bin/bash
if [ $(id -u) -ne 0 ]; then
printf "Script must be run as root. Try 'sudo bash'\n"
exit 1
fi
echo "Installation d'un serveur VNC sur la machine"
apt-get install tightvncserver
cat <<EOF > /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
#! /bin/sh
# /etc/init.d/vncboot
USER=root
HOME=/root
export USER HOME
case "$1" in
start)
echo "Starting VNC Server"
#Insert your favoured settings for a VNC session
/usr/bin/vncserver :0 -geometry 1280x800 -depth 16 -pixelformat rgb565
;;
stop)
echo "Stopping VNC Server"
/usr/bin/vncserver -kill :0
;;
*)
echo "Usage: /etc/init.d/vncboot {start|stop}"
exit 1
;;
esac
exit 0
EOF
chmod 755 /etc/init.d/vncboot
update-rc.d vncboot defaults
service vncboot start
echo "Installation terminé"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment