Added installer

This commit is contained in:
Phil 2023-12-14 22:49:13 +00:00
parent 430c28e400
commit 06c7c6f166
4 changed files with 49 additions and 0 deletions

49
install.sh Executable file
View File

@ -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

BIN
sav.tar Executable file

Binary file not shown.

BIN
talpa.tar Executable file

Binary file not shown.

BIN
uncdownload.tar Executable file

Binary file not shown.