Magellan Linux

Annotation of /trunk/consolekit/pam-foreground-compat.ck

Parent Directory Parent Directory | Revision Log Revision Log


Revision 930 - (hide annotations) (download)
Sun Nov 8 03:47:35 2009 UTC (14 years, 11 months ago) by niro
File size: 389 byte(s)
-files and fixes for consolekit-0.4.1-r1

1 niro 930 #!/bin/sh
2     TAGDIR=/var/run/console
3    
4     [ -n "$CK_SESSION_USER_UID" ] || exit 1
5    
6     TAGFILE="$TAGDIR/`getent passwd $CK_SESSION_USER_UID | cut -f 1 -d:`"
7    
8     if [ "$1" = "session_added" ]; then
9     mkdir -p "$TAGDIR"
10     echo "$CK_SESSION_ID" >> "$TAGFILE"
11     fi
12    
13     if [ "$1" = "session_removed" ] && [ -e "$TAGFILE" ]; then
14     sed -i "\%^$CK_SESSION_ID\$%d" "$TAGFILE"
15     [ -s "$TAGFILE" ] || rm -f "$TAGFILE"
16     fi
17