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