From 97df5941b08cd53aa66937ded412fa58aac531aa Mon Sep 17 00:00:00 2001 From: Constantin Berhard Date: Mon, 14 Oct 2013 20:40:06 +0200 Subject: [PATCH] command who --- tyshell | 6 ++++++ 1 file changed, 6 insertions(+) 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): -- 2.30.2