source: trunk/debathena/debathena/dotfiles/quotawarn.sh @ 22913

Revision 22913, 1.5 KB checked in by tabbott, 17 years ago (diff)
In dotfiles: * Merge in quilt patches. These and other changes are summarized below. * Remove platform-specific code for non-Linux architectures. * Remove mksessiondirs and other ATHENA_SESSION_TMPDIr code; this is now handled by pam_mktemp * Run from.debathena and quota.debathena rather than from/quota in case debathena-from-config/debathena-quota-config are not installed * Remove unecessary athena/ from paths, except in prototype files which should remain unchanged for compatability. * Remove ancient extend alias from tcsh dotfiles. * Set ZEPHYR_CLIENT to not run zwgc on dialups; this avoids problems with zephyr in Debian automatically gaining focus. * Remove code for handling temporary home directories, since those can't happen anymore. * Stop setting XDG_DATA_DIRS; this is now controlled by debathena-desktop-config. * Stop setting COREDUMPSIZE; this was an IRIX workaround * Stop setting LD_LIBRARY_PATH to /usr/athena/lib; this breaks building things when /usr/athena is a symlink. * Stop setting XUSERFILESEARCHPATH to a directory that doesn't exist. * Change renew alias to use 'kinit -54' so we no longer require modified Kerberos. * Stop setting MANPATH, since we'd be setting it to the default anyway. * Remove athena_path logic, since athena_path would be PATH. * Only have one copy of the add alias, now that athena_path is gone. * Remove add_flags since it is always empty. * Don't temporarily remove add in cshrc. * Stop setting CDPATH. * Stop changing the default prompt for bash; the Debian default is better. * Stop changing the default prompt for tcsh, but leave the prompt character change, since there's a lot of documentation that uses it. * Stop configuring tcsh to not stat /afs/* when tab-completing; fakestat handles this. * Remove tcsh warning for "bind" alias.
Line 
1#!/bin/sh
2
3# $Id: quotawarn.sh,v 1.4 2007-04-09 17:13:19 ghudson Exp $
4
5# Determine the user's home directory usage and quota.
6qline=`quota.debathena -v -f "$USER" | awk '/^\// {print}'`
7usage=`echo "$qline" | awk '{print $2}'`
8quota=`echo "$qline" | awk '{print $3}'`
9quota90=`expr "${quota:-0}" \* 9 / 10`
10
11if [ -n "$usage" -a -n "$quota" ] && [ "$usage" -ge "$quota" ]; then
12  zenity --error --text="
13Your home directory usage exceeds your quota (${usage}KB
14used out of ${quota}KB).  You will be unable to use
15Athena normally until you free up space by deleting
16unneeded files.  You may find the following command
17useful to identify unneeded files:
18
19  athrun consult helpquota"
20elif [ -n "$usage" -a -n "$quota90" ] && [ "$usage" -ge "$quota90" ]; then
21  zenity --info --text="
22Your home directory usage is near your quota (${usage}KB
23used out of ${quota}KB).  Consider removing unneeded
24files to free up space.  You may find the following
25command useful to identify unneeded files:
26
27  athrun consult helpquota"
28fi
29
30# Determine the user's mail usage and quota.
31qline=`mailquota | tail +2`
32usage=`echo "$qline" | awk '{print $2}'`
33quota=`echo "$qline" | awk '{print $3}'`
34quota90=`expr "${quota:-0}" \* 9 / 10`
35
36if [ -n "$usage" -a -n "$quota90" ] && [ "$usage" -ge "$quota90" ]; then
37  zenity --info --text="
38Your MIT mail usage is close to or exceeding your mail
39quota (${usage}KB used out of ${quota}KB).  Consider
40removing unneeded mail messages to free up space.  You
41may find the following command useful to identify which
42mail folders need the most attention:
43
44  mailusage"
45fi
Note: See TracBrowser for help on using the repository browser.