home *** CD-ROM | disk | FTP | other *** search
/ Chip: Special Survival Kit / Chip_Special_Survival_Kit_fuer_PC_Anwender.iso / PaperOut / NEXTSTEP / PaperOut.app / installUser < prev    next >
Encoding:
Text File  |  1994-06-01  |  1.2 KB  |  65 lines

  1. #!/bin/sh
  2.  
  3. usage="usage: $0 application_path home_directory"
  4. version=210
  5. curr_version=210
  6.  
  7. if [ $# -ne 2 ]; then
  8.     echo $usage
  9.     exit 1
  10. fi
  11.  
  12. app_path=$1
  13. users_home=$2
  14.  
  15. lib_path="$users_home/Library"
  16. services_path="$lib_path/Services"
  17.  
  18. shelf_path="$lib_path/PaperOut"
  19. shelf_file="PaperOut.shelf"
  20. book_path="$shelf_path/books"
  21. trans_path="$book_path/translate"
  22.  
  23. installed="$users_home/.PaperOut"
  24.  
  25. if test -r $shelf_path/$shelf_file ; then
  26.     if test -r $installed ; then
  27.     curr_version=`cat $installed | awk '{ iv=$1;printf("%d",iv) }'`
  28.     if [ $curr_version -eq $version ]; then
  29.         # Current PaperOut version is installed
  30.         exit 0
  31.     fi
  32.     fi
  33. fi
  34.  
  35. shelf_backup="PaperOutV$curr_version.shelf"
  36.  
  37. umask 022
  38.  
  39. if test ! -d $lib_path ; then
  40.     mkdir $lib_path
  41. fi
  42. if test ! -d $services_path ; then
  43.     mkdir $services_path
  44. fi
  45. if test ! -d $shelf_path ; then
  46.     mkdir $shelf_path
  47. fi
  48. if test ! -d $book_path ; then
  49.     mkdir $book_path
  50. fi
  51. if test ! -d $trans_path ; then
  52.     mkdir $trans_path
  53. fi
  54.  
  55. if test -r $app_path/$shelf_file ; then
  56.     if test -r $shelf_path/$shelf_file ; then
  57.     cp $shelf_path/$shelf_file $shelf_path/$shelf_backup
  58.     fi
  59.     cp $app_path/$shelf_file $shelf_path/$shelf_file
  60. fi
  61.  
  62. echo "$version `whoami` `date`" > $installed
  63.  
  64. exit 2
  65.