* Make sure that automatic closing of connections only affects
[alpine.git] / web / bin / usage.tcl
blob8b597951508ad7aff1b06d31374b9f761b16edfe
1 #!./tclsh
2 # $Id: usage.tcl 1169 2008-08-27 06:42:06Z hubert@u.washington.edu $
3 # ========================================================================
4 # Copyright 2008 University of Washington
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # ========================================================================
14 # Return mail store usage numbers on stdout separated by a space
15 # First number is amount of usage
16 # Second is total amount of space available
17 # Integer values. Unit are megabytes (MB).
19 set cmd "exec -- /usr/local/bin/dmq -u [lindex $argv 0]"
20 if {0 == [catch {eval $cmd} result]} {
21 if {[regexp {^[0-9]+[ \t]+([0-9]+)\.[0-9]*[ \t]+([0-9]+)$} $result dummy usage total]} {
22 puts stdout "$usage $total"