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

Revision 23027, 1.5 KB checked in by ghudson, 16 years ago (diff)
Add a debathena-xsession package for graphical session integration.
  • Property svn:executable set to *
Line 
1#!/bin/sh
2
3# Determine the user's home directory usage and quota.
4qline=`quota.debathena -v -f "$USER" | awk '/^\// {print}'`
5usage=`echo "$qline" | awk '{print $2}'`
6quota=`echo "$qline" | awk '{print $3}'`
7quota90=`expr "${quota:-0}" \* 9 / 10`
8
9if [ -n "$usage" -a -n "$quota" ] && [ "$usage" -ge "$quota" ]; then
10  zenity --error --text="
11Your home directory usage exceeds your quota (${usage}KB
12used out of ${quota}KB).  You will be unable to use
13Athena normally until you free up space by deleting
14unneeded files.  You may find the following command
15useful to identify unneeded files:
16
17  athrun consult helpquota"
18elif [ -n "$usage" -a -n "$quota90" ] && [ "$usage" -ge "$quota90" ]; then
19  zenity --info --text="
20Your home directory usage is near your quota (${usage}KB
21used out of ${quota}KB).  Consider removing unneeded
22files to free up space.  You may find the following
23command useful to identify unneeded files:
24
25  athrun consult helpquota"
26fi
27
28# Determine the user's mail usage and quota.
29qline=`mailquota | tail +2`
30usage=`echo "$qline" | awk '{print $2}'`
31quota=`echo "$qline" | awk '{print $3}'`
32quota90=`expr "${quota:-0}" \* 9 / 10`
33
34if [ -n "$usage" -a -n "$quota90" ] && [ "$usage" -ge "$quota90" ]; then
35  zenity --info --text="
36Your MIT mail usage is close to or exceeding your mail
37quota (${usage}KB used out of ${quota}KB).  Consider
38removing unneeded mail messages to free up space.  You
39may find the following command useful to identify which
40mail folders need the most attention:
41
42  mailusage"
43fi
Note: See TracBrowser for help on using the repository browser.