summaryrefslogtreecommitdiff
path: root/source4/scripting/bin/smbstatus
blob: 9f7566a6420e488ebfb5364e05ef6fc42d6fab8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
exec smbscript "$0" ${1+"$@"}
/*
  provide information on connected users and open files
  Copyright Andrew Tridgell 2005
  Released under the GNU GPL v2 or later
*/	

libinclude("base.js");
libinclude("management.js");

var options = new Object();

ok = GetOptions(ARGV, options,
		"POPT_AUTOHELP",
		"POPT_COMMON_SAMBA");
if (ok == false) {
   println("Failed to parse options: " + options.ERROR);
   return -1;
}


var sessions = smbsrv_sessions();
if (sessions == undefined) {
	println("No sessions");
	exit(0);
}
printVars(sessions);

var trees = smbsrv_trees();
if (trees == undefined) {
	println("No trees");
	exit(0);
}
printVars(trees);

return 0;