Thanks Craig!

Actually, I made a dumb configuration error. My script works fine as a 
KIOSK_SESSION_PRE. 

Here's my script:

#!/bin/bash
#exec 2>/var/opt/SUNWut/log/setlocation.$DISPLAY.$$ 1>&2  # Debug
#set -x
logger -p user.debug -t setlocation.sh "setlocation.sh start"
# Sets the location field in the desktops tab
# if it is not set, otherwise silently exits.
# Run as KIOSK_SESSION_PRE so it runs as root
# since utdesktop requires root privs to update
# Get the display
myDISP=$(echo ${DISPLAY} | sed 's/.*:\([^.]*\).*/\1/')
# Get the MAC Address
myTERMID=$(sed -n 's/^TERMINAL_ID=.*\.//p' /tmp/SUNWut/config/dispinfo/$myDISP)
# Get the Location and OtherInfo fields
myLocation=$(/opt/SUNWut/sbin/utdesktop -p ${myTERMID} | sed -n 
's/.*Location.*= //p')
myOtherInfo=$(/opt/SUNWut/sbin/utdesktop -p ${myTERMID} | sed -n 's/.*Other 
Info.*= //p')
# Now check to see what we need to do
if [ -z ${myLocation} ];
    then
        while [ -z ${myLocation} ];
        do
           myLocation=$(/usr/bin/zenity --entry --title="Update Location" 
--text="Enter your room number:" | sed 's/[^0-9]//g');
        done
# Now update the directory
        /opt/SUNWut/sbin/utdesktop -e 
"${myTERMID}","${myLocation}","${myOtherInfo}"
fi


If I enable the set -x log, I see errors from Xlib about not being able to 
access the display, but the script works. 

Art

_______________________________________________
SunRay-Users mailing list
SunRay-Users@filibeto.org
http://www.filibeto.org/mailman/listinfo/sunray-users

Reply via email to