3 linenum
=LINENUMBERPLACEHOLDER
5 UNPACKDIR
=/var
/tmp
/unpack_PRODUCTNAMEPLACEHOLDER
6 diskSpaceRequired
=DISCSPACEPLACEHOLDER
7 checksum
=CHECKSUMPLACEHOLDER
15 # Determining current platform
31 # Asking for the unpack directory
34 echo "Select the directory in which to save the unpacked files. [$UNPACKDIR] "
36 if [ "x$reply" != "x" ]
41 if [ -d $UNPACKDIR ]; then
42 printf "Directory $UNPACKDIR already exists.\n"
43 printf "Please select a new directory name.\n"
49 mkdir
-m 700 $UNPACKDIR
51 diskSpace
=`df -k $UNPACKDIR | $tail_prog -1 | awk '{if ( $4 ~ /%/) { print $3 } else { print $4 } }'`
52 if [ $diskSpace -lt $diskSpaceRequired ]; then
53 printf "The selected drive does not have enough disk space available.\n"
54 printf "PRODUCTNAMEPLACEHOLDER requires at least %s kByte.\n" $diskSpaceRequired
58 trap 'rm -rf $UNPACKDIR; exit 1' HUP INT QUIT TERM
60 if [ -x /usr
/bin
/sum ] ; then
61 echo "File is being checked for errors ..."
63 sum=`$tail_prog +$linenum $0 | /usr/bin/sum`
64 sum=`echo $sum | awk '{ print $1 }'`
66 if [ $sum != $checksum ]; then
67 echo "The download file appears to be corrupted. Please download PRODUCTNAMEPLACEHOLDER again."
74 $tail_prog +$linenum $0 |
(cd $UNPACKDIR; tar xf
-)
76 echo "All files have been successfully unpacked."
78 if [ "$EXTRACTONLY" != "yes" ]
80 if [ -f $UNPACKDIR/setup
]
82 chmod 775 $UNPACKDIR/setup