# # default /etc/profile # # Zoidial, Inc. # Eric Thern eric@zoidial.com # 2001 / 2002 # BLOCKSIZE=K; export BLOCKSIZE PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/bin:/usr/X11R6/bin:$HOME/bin; export PATH readonly HISTFILE readonly HISTFILESIZE readonly HISTSIZE # # This sets the global bash TMOUT variable for timing out sessions # works well on users who idle and do nothing # interactive sessions (ie: pine, vi, etc.) will not be timed with this. # if test -z "id -p | egrep '(wheel|root|staff)'" then # # set 2 hour login times for all users # TMOUT=3600 readonly TMOUT else # # except for groups wheel, root, staff # TMOUT=0 fi TERM=xterm-color export TERM export EDITOR="/usr/bin/vi" msgs -f mesg y alias ls="ls -G" alias dir=ls PS1="\n[\u@\H] [(tty)\l] [\d \@]\n[\w]\\$ " export PS1 # User Specific Entries # # These are for showing user bandwidth, processes and quota # # requires following in root crontab: # */5 * * * * /sbin/ipfw show |grep uid > /etc/drgchkip # */5 * * * * /usr/sbin/repquota -u /usr/home > /etc/drgchk # # Bandwidth requires the following rule to be run: # for i in `cat /etc/passwd | cut -f1 -d:`; do /sbin/ipfw -q add 00002 count ip from any to any uid $i; done # # some of this is a bit messy, i'm no code genius! # quota=$( cat /etc/drgchk |grep "$USER " -n |grep ":$USER " | awk '{ print $4/1000 }') space=$( cat /etc/drgchk |grep "$USER " -n |grep ":$USER " | awk '{ print $3/1000 }') bandwidth=$( cat /etc/drgchkip |grep " $USER" | awk '{ print $3/1024/1024 }') processes=$(ps aux |grep "$USER " -n |grep ":$USER " | wc -l | awk '{ if ( $1-7 < 0 ) print 0; else print $1-7 }') echo "" echo -e "\033[1;34mBandwidth Used (\033[1;30m+\033[1;34m): \033[1;30m$bandwidth MB" echo -e "\033[1;34mProcesses Running: \033[1;30m$processes" echo -e "\033[1;34mQuota Limit: \033[1;30m$quota MB" echo -e "\033[1;34mQuota Usage: \033[1;30m$space MB" echo "(+) since last firewall reset " echo "(does not include all traffic)" echo -e "\033[1;0m"