From 5061e3dc70b3440d1a22d7aa21556bbae832b0a4 Mon Sep 17 00:00:00 2001 From: Omar Vega Ramos Date: Sat, 16 Jan 2016 14:26:15 -0500 Subject: consolekit-1.0.1-2: updating version --- pcr/consolekit/pam-foreground-compat.ck | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 pcr/consolekit/pam-foreground-compat.ck (limited to 'pcr/consolekit/pam-foreground-compat.ck') 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 + -- cgit v1.2.3-54-g00ecf