X-Git-Url: https://git.ralfj.de/saartuer.git/blobdiff_plain/abb21b78411793efcdf8832f6837201bfc4ce15c..97df5941b08cd53aa66937ded412fa58aac531aa:/tyshell?ds=inline diff --git a/tyshell b/tyshell index 1b90bd0..c9a0927 100755 --- 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):