Brickmasterj,
Yep, een beetje aanpassen:
#!/bin/bash
# Self Extracting Template File Extract.sh
# Destination directory is DIR
# Usage: cat Extract.sh tarfile > SelfExtract.sh
DIR=/var/tmp
echo "Extracting file into $DIR"
# searches for the line number where finish the script and start the tar.gz
SKIP=`awk '/^__TARFILE_FOLLOWS__/ { print NR + 1; exit 0; }' $0`
#remember our file name
THIS=`pwd`/$0
# take the tarfile and pipe it into tar
tail -n +$SKIP $THIS | tar -xz --directory=$DIR
# 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__
Op deze manier wordt de tar-ball uitgepakt in /var/tmp/.....
Je hoeft alleen wat achter DIR= staat te wijzigen.