4 smbstatus
-p |
sed /^$
/d|
sed 1,/^
-/d
> /tmp
/smbpid
7 <h3><font color=blue>当前所有连接</color></h3>
9 echo '<table cellspacing="2" cellpadding="8" border="0" width="90%">'
10 #echo "<tr class="color_table_heading"><th>User</th><th>Share</th><th>Pid</th><th>Connect From</th></tr>"
11 echo "<tr bgcolor=\"#c6d5a8\"><th>用户名</th><th>访问共享名</th><th>进程id</th><th>连接自计算机</th></tr>"
14 eval pid
=$
(echo $line | cut
-f1 -d' ')
15 eval smbpid
[$pid]=$
(echo $line|cut
-f2 -d' ');
19 smbstatus
-S |
sed '/^$/d' |
sed '1,/^-/d' > /tmp
/smbshare
2>/dev
/null
22 echo -e '<form name="delete_users">'
25 [ $_n = 2 ] && _n
=1 || _n
=2
26 pid
=$
(echo $line | cut
-f2 -d ' ')
27 echo "$_n ${smbpid[$pid]} $line " |
awk '
28 { print "<tr class=color_table_row"$1"><td>"$2"</td><td>"$3"</td><td>"$4"</td><td>"$5"</td></tr>" }'