home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 9.ddi / usr / lib / acct / chargefee < prev    next >
Encoding:
Text File  |  1990-12-08  |  937 b   |  39 lines

  1. #!/sbin/sh
  2. #    Copyright (c) 1990 UNIX System Laboratories, Inc.
  3. #    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T
  4. #      All Rights Reserved
  5.  
  6. #    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF
  7. #    UNIX System Laboratories, Inc.
  8. #    The copyright notice above does not evidence any
  9. #    actual or intended publication of such source code.
  10.  
  11.  
  12.  
  13. #ident    "@(#)/usr/lib/acct/chargefee.sl 1.1 4.0 12/08/90 45884 AT&T-USL"
  14. #    "chargefee login-name number"
  15. #    "emits tacct.h/ascii record to charge name $number"
  16. cd /var/adm
  17. PATH=/usr/lib/acct:/usr/bin:/usr/sbin
  18. if test $# -lt 2; then
  19.     echo "usage: chargefee name number"
  20.     exit
  21. fi
  22. _entry="`grep \^$1: /etc/passwd`"
  23. if test -z "${_entry}"; then
  24.     echo "can't find login name $1"
  25.     exit
  26. fi
  27. case "$2"  in
  28. -[0-9]*|[0-9]*);;
  29. *)
  30.     echo "charge invalid: $2"
  31.     exit
  32. esac
  33.  
  34. if test ! -r fee; then
  35.     nulladm fee
  36. fi
  37. _userid=`echo "${_entry}" | cut -d: -f3`  # get the UID
  38. echo  "${_userid} $1 0 0 0 0 0 0 0 0 0 0 $2"  >>fee
  39.