tyshell who works now
authorConstantin Berhard <constantin@exxxtremesys.lu>
Mon, 14 Oct 2013 18:46:03 +0000 (20:46 +0200)
committerConstantin Berhard <constantin@exxxtremesys.lu>
Mon, 14 Oct 2013 18:46:03 +0000 (20:46 +0200)
tyshell

diff --git a/tyshell b/tyshell
index c9a09273c96d837f1e3a018320aa8122e961e1b8..8d7070a06a8874bef7fe4660f86f79133cf7ea83 100755 (executable)
--- a/tyshell
+++ b/tyshell
@@ -6,6 +6,7 @@ import sys
 import subprocess
 import socket
 import pwd
+import grp
 
 tuerSock = "/run/tuer.sock"
 
@@ -46,7 +47,8 @@ def exitcmd(c):
        return True
 
 def whocmd(c):
-       for p in filter(lambda x:x.pw_shell=="/opt/tuer/tyshell",pwd.getpwall()):
+       for n in grp.getgrnam("tuer").gr_mem:
+               p = pwd.getpwnam(n)
                print (p.pw_name, " - ", p.pw_gecos)
 
 commands = {