home *** CD-ROM | disk | FTP | other *** search
/ norge.freeshell.org (192.94.73.8) / 192.94.73.8.tar / 192.94.73.8 / pub / sdf / historical / dupe < prev    next >
Text File  |  1995-01-27  |  973b  |  56 lines

  1. # duplicate account stuff
  2. #
  3. trap  ""  2 3 15
  4.  
  5. user=`who am i | sed "s/ .*//"`
  6. if [ -z "$user" ]    # 8-character bug hack
  7. then
  8.     user=$LOGNAME
  9. fi
  10. if [ "$user" = "$1" ]
  11. then    other=$2
  12. elif [ "$user" = "$2" ]
  13. then    other=$1
  14. else
  15.     mail sp <<DupeFiX
  16. Subject: Duplicate: $user ($1 $2)
  17.  
  18. $user did not match either "$1" or "$2"!
  19. DupeFiX
  20.     exit
  21. fi
  22.  
  23. itema="keep \"$user\" and delete \"$other\""
  24. itemb="keep \"$other\" and delete \"$user\""
  25. itemc="keep \"$other\", but with the password from \"$user\", and delete \"$user\""
  26. ans=""
  27. while [ -z "$ans" ]
  28. do
  29.     echo
  30.     echo "You seem to have a duplicate account named \"$other\"."
  31.     echo "Do you want to:"
  32.     echo
  33.     echo "  A) $itema"
  34.     echo "  B) $itemb"
  35.     echo "  C) $itemc"
  36.     echo
  37.     echo "your choice: \c"
  38.     read ans
  39.     case $ans in
  40.     a|A)    doit=$itema;;
  41.     b|B)    doit=$itemb;;
  42.     c|C)    doit=$itemc;;
  43.     *)    ans=""
  44.         echo
  45.         echo "Please try that again...";;
  46.     esac
  47. done
  48.  
  49. mail sp <<DupeFiX
  50. Subject: Duplicate: $user ($1 $2)
  51.  
  52. $user wants to $doit.
  53. DupeFiX
  54.  
  55. trap 2 3 15
  56.