diff options
author | Omar Vega Ramos <ovruni@gnu.org.pe> | 2016-01-16 14:26:15 -0500 |
---|---|---|
committer | Omar Vega Ramos <ovruni@gnu.org.pe> | 2016-01-16 14:26:15 -0500 |
commit | 5061e3dc70b3440d1a22d7aa21556bbae832b0a4 (patch) | |
tree | 10a09ded27d0acc2ac140499e32a9f4b89af2353 /pcr/consolekit/pam-foreground-compat.ck | |
parent | b235b0f2e9478625acada50e9c3d8026091f8331 (diff) |
consolekit-1.0.1-2: updating version
Diffstat (limited to 'pcr/consolekit/pam-foreground-compat.ck')
-rw-r--r-- | pcr/consolekit/pam-foreground-compat.ck | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/pcr/consolekit/pam-foreground-compat.ck b/pcr/consolekit/pam-foreground-compat.ck new file mode 100644 index 000000000..90b8081e4 --- /dev/null +++ b/pcr/consolekit/pam-foreground-compat.ck @@ -0,0 +1,17 @@ +#!/bin/sh +TAGDIR=/run/console + +[ -n "$CK_SESSION_USER_UID" ] || exit 1 + +TAGFILE="$TAGDIR/`getent passwd $CK_SESSION_USER_UID | cut -f 1 -d:`" + +if [ "$1" = "session_added" ]; then + mkdir -p "$TAGDIR" + echo "$CK_SESSION_ID" >> "$TAGFILE" +fi + +if [ "$1" = "session_removed" ] && [ -e "$TAGFILE" ]; then + sed -i "\%^$CK_SESSION_ID\$%d" "$TAGFILE" + [ -s "$TAGFILE" ] || rm -f "$TAGFILE" +fi + |