home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- usage="usage: $0 application_path home_directory"
- version=210
- curr_version=210
-
- if [ $# -ne 2 ]; then
- echo $usage
- exit 1
- fi
-
- app_path=$1
- users_home=$2
-
- lib_path="$users_home/Library"
- services_path="$lib_path/Services"
-
- shelf_path="$lib_path/PaperOut"
- shelf_file="PaperOut.shelf"
- book_path="$shelf_path/books"
- trans_path="$book_path/translate"
-
- installed="$users_home/.PaperOut"
-
- if test -r $shelf_path/$shelf_file ; then
- if test -r $installed ; then
- curr_version=`cat $installed | awk '{ iv=$1;printf("%d",iv) }'`
- if [ $curr_version -eq $version ]; then
- # Current PaperOut version is installed
- exit 0
- fi
- fi
- fi
-
- shelf_backup="PaperOutV$curr_version.shelf"
-
- umask 022
-
- if test ! -d $lib_path ; then
- mkdir $lib_path
- fi
- if test ! -d $services_path ; then
- mkdir $services_path
- fi
- if test ! -d $shelf_path ; then
- mkdir $shelf_path
- fi
- if test ! -d $book_path ; then
- mkdir $book_path
- fi
- if test ! -d $trans_path ; then
- mkdir $trans_path
- fi
-
- if test -r $app_path/$shelf_file ; then
- if test -r $shelf_path/$shelf_file ; then
- cp $shelf_path/$shelf_file $shelf_path/$shelf_backup
- fi
- cp $app_path/$shelf_file $shelf_path/$shelf_file
- fi
-
- echo "$version `whoami` `date`" > $installed
-
- exit 2
-