source: trunk/debathena/debathena/xsession/debian/quotawarn @ 24129

Revision 24129, 1.7 KB checked in by broder, 14 years ago (diff)
In xsession: * Demote mitmailutils to a recommendation while it's uninstallable on krb4-less systems.
  • Property svn:executable set to *
3# Start warning when a usage is less than this many kilobytes away
4# from your quota
7# Determine the user's home directory usage and quota.
8qline=`quota.debathena -v -f "$USER" | awk '/^\// {print}'`
9usage=`echo "$qline" | awk '{print $2}'`
10quota=`echo "$qline" | awk '{print $3}'`
11warnlevel=`expr "${quota:-0}" - ${tolerance}`
13if [ -n "$usage" -a -n "$quota" ] && [ "$usage" -ge "$quota" ]; then
14  zenity --error --text="
15Your home directory usage exceeds your quota (${usage}KB
16used out of ${quota}KB).  You will be unable to use
17Athena normally until you free up space by deleting
18unneeded files.  You may find the following command
19useful to identify unneeded files:
21  athrun consult helpquota"
22elif [ -n "$usage" -a -n "$warnlevel" ] && [ "$usage" -ge "$warnlevel" ]; then
23  zenity --info --text="
24Your home directory usage is near your quota (${usage}KB
25used out of ${quota}KB).  Consider removing unneeded
26files to free up space.  You may find the following
27command useful to identify unneeded files:
29  athrun consult helpquota"
32if hash mailquota 2>/dev/null; then
33    # Determine the user's mail usage and quota.
34    qline=`mailquota | tail -n +2`
35    usage=`echo "$qline" | awk '{print $2}'`
36    quota=`echo "$qline" | awk '{print $3}'`
37    warnlevel=`expr "${quota:-0}" - ${tolerance}`
39    if [ -n "$usage" -a -n "$warnlevel" ] && [ "$usage" -ge "$warnlevel" ]; then
40        zenity --info --text="
41Your MIT mail usage is close to or exceeding your mail
42quota (${usage}KB used out of ${quota}KB).  Consider
43removing unneeded mail messages to free up space.  You
44may find the following command useful to identify which
45mail folders need the most attention:
47  mailusage"
48    fi
Note: See TracBrowser for help on using the repository browser.