gdmdynamic revision 16985
#!/bin/ksh -p
optype=""
oparg=""
for i in "$@"
do
if [ ! "x$optype" = "x" ]; then
oparg=$i
break
fi
if [ "x$i" = "x-a" ]; then
optype="add"
continue
fi
if [ "x$i" = "x-d" ]; then
optype="delete"
continue
fi
if [ "x$i" = "x-l" ]; then
optype="list"
break
fi
done
case $optype in
add)
# gdmdynamic -a 10=/usr/X11/bin/Xorg
oparg=`echo $oparg | awk -F\= '{print $1}'`
/usr/sbin/ck-seat-tool -a --display-type=Sunray display=:$oparg
;;
delete)
# gdmdynamic -d 10
ssid=`/usr/bin/ck-list-sessions -f session-id,x11-display,display-type | grep Sunray | grep ":$oparg" | awk '{print $1}'`
if [ ! "x$ssid" = "x" ]; then
/usr/sbin/ck-seat-tool -d --session-id=$ssid
fi
;;
list)
# gdmdynamic -l
sessions=`/usr/bin/ck-list-sessions -f session-id,x11-display,display-type | grep Sunray | awk '{print $3}'`
dyps=""
for i in $sessions
do
if [ ! "x$i" = "x" ]; then
dyps="$i;$dyps"
fi
done
echo $dyps
;;
esac