Various fixes
[public/netxms.git] / tools / stub.sh
index d8d660f..719c499 100755 (executable)
@@ -19,55 +19,10 @@ trap '
 rm -f $log
 echo "WD = $wd" >> $log
 
-_PATH=$PATH
-PATH=$PATH:`echo /opt/openssl*/bin | tr ' ' ':'`
-export PATH
-md5=
-for app in openssl md5sum md5;
-do
-       tmp=`which $app 2>/dev/null`
-       if [ $? = 0 ]; then
-               echo $tmp | grep "no $app in " >/dev/null 2>&1
-               if [ $?  != 0 ]; then
-                       md5=$tmp
-                       [ $app = "openssl" ] && md5="$md5 md5"
-               fi
-       fi
-done
-PATH=$_PATH
-export PATH
-
-tail="tail -n"
-if [ `uname` = "SunOS" ]; then
-       tail=tail
-       mktemp() {
-               d=/tmp/nxupdate.$$.UniQ
-               mkdir $d && echo $d || false
-       }
-fi
-
-if [ "x$md5" != "x" ]; then
-       if [ "X"`head -n$skip $0 |
-               $tail +5 |
-               $md5 |
-               cut -b1-32 |
-               tr A-Z a-z` != "X"$hash1 ];
-       then
-               echo "Script MD5 mismach" >> $log
-               exit
-       fi
-
-       if [ "X"`$tail +$skip1 $0 |
-               $md5 |
-               cut -b1-32 |
-               tr A-Z a-z` != "X"$hash2 ];
-       then
-               echo "Payload MD5 mismach" >> $log
-               exit
-       fi
-else
-       echo "No md5/md5sum/openssl found, can't check integrity" >> $log
-fi
+mktemp() {
+       d=/tmp/nxupdate.$$.UniQ
+       mkdir $d && echo $d || false
+}
 
 temp=`mktemp -d /tmp/nxinst.XXXXXX 2>/dev/null`
 if [ $? != 0 ]; then
@@ -75,7 +30,7 @@ if [ $? != 0 ]; then
        exit 0
 fi
 cd $temp
-$tail +$skip1 $wd/$0 | gzip -dc 2>/dev/null | tar xf -
+tail +$skip1 $wd/$0 | gzip -dc 2>/dev/null | tar xf -
 if [ $? != 0 ]; then
        echo "Can't unpack" >> $log
        exit;