home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1999 March B / SCO_CASTOR4RRT.iso / cmds / root.3 / usr / lib / acct / chargefee / chargefee~
Text File  |  1998-08-19  |  1KB  |  40 lines

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