Hi There,
I want to compile a self extracting tar file and found following:
http://www.stuartwells.net/slides/selfextract.htm which is very
helpful!
But I have three files in my archive:
prg (bin)
cksum (bin)
copy_file.sh (shell script)
and i made changes to the script from the website to make it look like
this:
[script]
#!/bin/bash
echo ""
echo "Self Extracting Tar File"
echo ""
echo "Example by Stuart Wells"
echo ""
echo "Extracting file into `pwd`"
SKIP=`awk '/^__TARFILE_FOLLOWS__/ { print NR + 1; exit 0; }' $0`
echo 'SKIP: '$SKIP;
#remember our file name
THIS=`/usr/share/working/`$0
echo 'THIS: '$THIS;
# take the tarfile and pipe it into tar
tail +$SKIP $THIS | tar -xz
#
# place any bash script here you need.
# Any script here will happen after the tar file extract.
echo "Finished"
exit 0
# NOTE: Don't place any newline characters after the last line below.
__TARFILE_FOLLOWS__
[script]
Now my script is gonna be called "prg" and upon execution(as root) i
get following error messages printed:
Extracting file into /usr/share/working
../prg: line 12: /usr/share/working: is a directory
THIS: ./prg
tar: Cannot create directory 'prg': File exists
tar:Couldn't remove old file: Not a directory
Finished
Can anyone direct me into the right direction? I've been playing
around with it already but I couldn't really get further a whole
lot...
Thanks a lot!
Ron