Browse Source

added ignore list

master
Robin Thoni 4 years ago
parent
commit
a34a9d08a0
1 changed files with 18 additions and 1 deletions
  1. 18
    1
      pam/notify-pam.sh

+ 18
- 1
pam/notify-pam.sh View File

@@ -1,6 +1,23 @@
1 1
 #! /usr/bin/env sh
2 2
 
3
-[ "$PAM_TYPE" = "open_session" ] || exit 0
3
+if [ ! "${PAM_TYPE}" = "open_session" ]
4
+then
5
+  exit 0
6
+fi
7
+
8
+if [ -e /etc/notify-pam/ignore-list ]
9
+then
10
+  while read line
11
+  do
12
+    user="$(echo "${line}" | cut -d' ' -f1)"
13
+    service="$(echo "${line}" | cut -d' ' -f2)"
14
+    if [ "${PAM_USER}" = "${user}" ] && [ "${PAM_SERVICE}" = "${service}" ]
15
+    then
16
+      exit 0
17
+    fi
18
+  done < /etc/notify-pam/ignore-list
19
+fi
20
+
4 21
 {
5 22
   echo "User: $PAM_USER"
6 23
   echo "Ruser: $PAM_RUSER"

Loading…
Cancel
Save