diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..a96e5da --- /dev/null +++ b/install.sh @@ -0,0 +1,49 @@ +#!/bin/sh +BASEDIR=`dirname $0` +echo $BASEDIR | grep "^/" >/dev/null +if [ $? -ne 0 ] ; then + BASEDIR=`pwd`/$BASEDIR +fi +if [ "" = "$TMPDIR" ] ; then + TMPDIR=/tmp +fi +_mktemp=`which mktemp 2>/dev/null` +if [ -x "${_mktemp}" ] ; then + tmpdirTemplate="$TMPDIR/sophos_distribution_XXXXXXX" + SOPHOS_INSTALL_TMP=`${_mktemp} -d ${tmpdirTemplate}` + [ $? = 0 ] || { echo "Could not create temporary directory" 1>&2 ; exit 1 ; } +else + _od=`which od 2>/dev/null` + if [ -x "${_od}" ] ; then + _random=/dev/urandom + [ -f "${_random}" ] || _random=/dev/random + SOPHOS_INSTALL_TMP=$TMPDIR/sophos_distribution_`${_od} -An -N16 -tu2 "${_random}" | tr -d " \t\r\n"`.$$ + else + SOPHOS_INSTALL_TMP=$TMPDIR/sophos_distribution_${RANDOM-0}.${RANDOM-0}.${RANDOM-0}.$$ + fi + + [ -d "${SOPHOS_INSTALL_TMP}" ] && { echo "Temporary directory already exists" 1>&2 ; exit 1 ; } + (umask 077 && mkdir ${SOPHOS_INSTALL_TMP}) || { echo "Could not create temporary directory" 1>&2 ; exit 1 ; } +fi +if [ ! -d "${SOPHOS_INSTALL_TMP}" ] ; then + echo "Could not create temporary directory" 1>&2 + exit 1 +fi + +echo "exit 0" > "$SOPHOS_INSTALL_TMP/exectest" && chmod +x "$SOPHOS_INSTALL_TMP/exectest" +$SOPHOS_INSTALL_TMP/exectest || { + echo "Cannot execute files within $TMPDIR directory. Please see KBA 131783 http://www.sophos.com/kb/131783" 1>&2 + rm -rf $SOPHOS_INSTALL_TMP + exit 15 +} + +export SOPHOS_INSTALL_TMP +cd $SOPHOS_INSTALL_TMP +tar xf "$BASEDIR/sav.tar" +[ -f "$BASEDIR/uncdownload.tar" ] && tar xf "$BASEDIR/uncdownload.tar" +[ -f "$BASEDIR/talpa.tar" ] && tar xf "$BASEDIR/talpa.tar" +sophos-av/install.sh "$@" +RETCODE=$? +cd / +rm -rf $SOPHOS_INSTALL_TMP +exit $RETCODE diff --git a/sav.tar b/sav.tar new file mode 100755 index 0000000..14e86e9 Binary files /dev/null and b/sav.tar differ diff --git a/talpa.tar b/talpa.tar new file mode 100755 index 0000000..b4b98f6 Binary files /dev/null and b/talpa.tar differ diff --git a/uncdownload.tar b/uncdownload.tar new file mode 100755 index 0000000..527381f Binary files /dev/null and b/uncdownload.tar differ