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

Revision 24133, 1.7 KB checked in by broder, 15 years ago (diff)
In xsession: * Close the conditional in quotawarn.
  • Property svn:executable set to *
Line 
1#!/bin/sh
2
3# Start warning when a usage is less than this many kilobytes away
4# from your quota
5tolerance=100000
6
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}`
12
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:
20
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:
28
29  athrun consult helpquota"
30fi
31
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}`
38
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:
46
47  mailusage"
48    fi
49fi
Note: See TracBrowser for help on using the repository browser.