projects
/
saartuer.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6f24ccf
)
command who
author
Constantin Berhard
<constantin@exxxtremesys.lu>
Mon, 14 Oct 2013 18:40:06 +0000
(20:40 +0200)
committer
Constantin Berhard
<constantin@exxxtremesys.lu>
Mon, 14 Oct 2013 18:40:06 +0000
(20:40 +0200)
tyshell
patch
|
blob
|
history
diff --git
a/tyshell
b/tyshell
index 1b90bd0ed0cb306b28988f88b5282e997ac7ad70..c9a09273c96d837f1e3a018320aa8122e961e1b8 100755
(executable)
--- a/
tyshell
+++ b/
tyshell
@@
-5,6
+5,7
@@
import shlex
import sys
import subprocess
import socket
+import pwd
tuerSock = "/run/tuer.sock"
@@
-44,12
+45,17
@@
def exitcmd(c):
print("Bye")
return True
+def whocmd(c):
+ for p in filter(lambda x:x.pw_shell=="/opt/tuer/tyshell",pwd.getpwall()):
+ print (p.pw_name, " - ", p.pw_gecos)
+
commands = {
'exit': exitcmd,
'help': helpcmd,
'open': sendcmd(tuerSock, 'unlock'),
'unlock': sendcmd(tuerSock, 'unlock'),
'buzz': sendcmd(tuerSock, 'buzz'),
+ 'who': whocmd,
}
def complete_command(cmd):