~ubuntu-branches/ubuntu/maverick/ldm/maverick

« back to all changes in this revision

Viewing changes to rc.d/S01-setup-xauth

  • Committer: Bazaar Package Importer
  • Author(s): Oliver Grawert
  • Date: 2008-06-24 12:46:32 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20080624124632-t01ij03530wtc60o
Tags: upstream-2.0.6
ImportĀ upstreamĀ versionĀ 2.0.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Sourced with .
 
2
#
 
3
# Script to add LDM server address to xauth
 
4
 
 
5
. /usr/share/ltsp/ltsp-common-functions
 
6
 
 
7
# FIXME: $ldm_log stuff are for debugging only, while not harmful
 
8
# we should probably remove it at some point.
 
9
 
 
10
if boolean_is_true "$LDM_DIRECTX"; then
 
11
    # FIXME: We probably want something better than head -1, however
 
12
    #        I am currently not sure which line exactly is desired.
 
13
    PROTOCOL=$(xauth -f $XAUTHORITY list | head -1 | awk '{print $2}')
 
14
    KEY=$(xauth -f $XAUTHORITY list | head -1| awk '{print $3}')
 
15
 
 
16
    ldm_log=/var/log/ldm.log
 
17
    echo "XAUTHORITY=$XAUTHORITY" >> $ldm_log
 
18
    echo "PROTOCOL=$PROTOCOL" >> $ldm_log
 
19
    echo "KEY=$KEY" >> $ldm_log
 
20
    echo "DISPLAY=$DISPLAY" >> $ldm_log
 
21
    echo "LDMINFO_IPADDR=$LDMINFO_IPADDR" >> $ldm_log
 
22
    echo "LDM_SERVER=$LDM_SERVER" >> $ldm_log
 
23
 
 
24
    echo $DISPLAY $LDMINFO_IPADDR $PROTOCOL $KEY >> $ldm_log
 
25
    ssh -S ${LDM_SOCKET} ${LDM_SERVER} \
 
26
        "xauth remove ${LDMINFO_IPADDR}${DISPLAY}" >> $ldm_log
 
27
    ssh -S ${LDM_SOCKET} ${LDM_SERVER} \
 
28
        "xauth add ${LDMINFO_IPADDR}${DISPLAY} ${PROTOCOL} ${KEY}" >> $ldm_log
 
29
fi