source: src-qt4/PCDM/PCDMd @ d0d990c

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3
Last change on this file since d0d990c was d0d990c, checked in by Kris Moore <kris@…>, 15 months ago

Add remote desktop support to PCDM via VNC. This will allow users
to enable VNC support and remote into their desktop system.

  • Property mode set to 100755
File size: 1.1 KB
Line 
1#!/bin/sh
2# Login daemon for PCDM
3# This listens for system login prompts and starts the main PCDM UI appropriately
4#------------------------------------
5
6PCDMCONF="/usr/local/etc/pcdm.conf"
7
8#See if VNC support is enabled for logging in to this system
9grep -q "^ALLOW_REMOTE_LOGIN=TRUE" ${PCDMCONF}
10if [ $? -eq 0 ]; then
11   # Setup default vnc server opts
12   vncopts="-forever "
13   grep -q "^REMOTE_SHARED_SCREEN=TRUE" ${PCDMCONF}
14   if [ $? -eq 0 ] ; then
15     vncopts="-shared "
16   else
17     vncopts="-nevershared "
18   fi
19   if [ -e "/usr/local/etc/vncpass" ] ; then
20     vnccmd="x11vnc -display :0 $vncopts -passwdfile /usr/local/etc/vncpass"
21   else
22     echo "WARNING: VNC enabled but no password in /usr/local/etc/vncpass!"
23     sleep 5
24   fi
25
26fi
27
28
29# Allow Auto-Login the first time PCDM starts
30touch /tmp/.PCDMAutoLogin
31# Now start the X Server
32while [ ! -e /var/run/nologin ]; do
33  /usr/local/bin/pc-checkxdisplay
34
35  if [ -n "$vnccmd" ] ; then
36    # Start VNC
37    (sleep 10 ; $vnccmd >/var/log/vncserver 2>/var/log/vncserver) &
38  fi
39
40  xinit /usr/local/bin/PCDM-session --once -- :0 
41done
Note: See TracBrowser for help on using the repository browser.