memtest probe
[mirrors/Programs.git] / bash / infect / hello
... / ...
CommitLineData
1#!/bin/sh
2skip=23
3set -C
4umask=`umask`
5umask 77
6tmpfile=`tempfile -p gztmp -d /tmp` || tmpfile=/tmp/gztmp.$$ || exit 1
7if /usr/bin/tail -n +$skip "$0" | /bin/gzip -cd >> $tmpfile; then
8 umask $umask
9 /bin/chmod 700 $tmpfile
10 prog="`echo $0 | /bin/sed 's|^.*/||'`"
11 if /bin/ln $tmpfile "/tmp/$prog" 2>/dev/null; then
12 trap '/bin/rm -f $tmpfile "/tmp/$prog"; exit $res' 0
13 (/bin/sleep 5; /bin/rm -f $tmpfile "/tmp/$prog") 2>/dev/null &
14 /tmp/"$prog" ${1+"$@"}; res=$?
15 else
16 trap '/bin/rm -f $tmpfile; exit $res' 0
17 (/bin/sleep 5; /bin/rm -f $tmpfile) 2>/dev/null &
18 $tmpfile ${1+"$@"}; res=$?
19 fi
20else
21 echo Cannot decompress $0; exit 1
22fi; exit $res
23