cnsworder
10/22/2015 - 1:56 AM

packedhead

#!/bin/bash

####################################
#      file:ackagehead.sh
#    author:cnsworder
#      date:2012-11-28
#  descript:打包脚本头 for linux
####################################

PACKAGE_PATH=$2
NAME=$1
`mkdir -p /tmp/sgsinstall`
TMPDIR=/tmp/sgsinstall

VER=$0
VER=${VER##*_}
VER=${VER%.*}

echo "SDS installing..."

ARCHIVE=`awk '/^__SGS_PACKAGE__/{print NR + 1; exit 0;}' $0`
tail -n +${ARCHIVE} $0 | tar zxv -C ${TMPDIR} &> /dev/null
CDIR=`pwd`
cd ${TMPDIR}
bash ./install
cd ${CDDIR}
rm -rf ${TMPDIR}
exit 0

__SGS_PACKAGE__