From ef948e53b7a4099663f55a9b1b3a23c6aa100b28 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 19 Jul 2005 06:08:06 +0000 Subject: r8583: nicer smbstatus output (This used to be commit 0578bcdf7f8919509a78a5c64f94aa5de7e90416) --- source4/scripting/bin/smbstatus | 58 ++++++++++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 13 deletions(-) (limited to 'source4') diff --git a/source4/scripting/bin/smbstatus b/source4/scripting/bin/smbstatus index 9f7566a642..eaf3aa1616 100755 --- a/source4/scripting/bin/smbstatus +++ b/source4/scripting/bin/smbstatus @@ -15,23 +15,55 @@ ok = GetOptions(ARGV, options, "POPT_AUTOHELP", "POPT_COMMON_SAMBA"); if (ok == false) { - println("Failed to parse options: " + options.ERROR); - return -1; + println("Failed to parse options: " + options.ERROR); + return -1; } - -var sessions = smbsrv_sessions(); -if (sessions == undefined) { - println("No sessions"); - exit(0); +/* + show open sessions +*/ +function show_sessions() +{ + var sessions = smbsrv_sessions(); + var i; + var sys = sys_init(); + if (sessions == undefined) { + println("No sessions open"); + return; + } + printf("User Client Connected at\n"); + printf("-------------------------------------------------------------------------------\n"); + for (i=0;i